Fix IE9 issue with shadow tree composition

msMatchesSelector does not work on elements that are not in the document