Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix IE9 issue with shadow tree composition
Browse files Browse the repository at this point in the history
msMatchesSelector does not work on elements that are not in the document
  • Loading branch information
arv committed Jan 23, 2014
1 parent 76028bf commit 4f091bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/ShadowRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,18 @@
if (!(node instanceof Element))
return false;

// The native matches function in IE9 does not correctly work with elements
// that are not in the document.
// TODO(arv): Implement matching in JS.
// https://github.com/Polymer/ShadowDOM/issues/361
if (select === '*' || select === node.localName)
return true;

// TODO(arv): This does not seem right. Need to check for a simple selector.
if (!selectorMatchRegExp.test(select))
return false;

// TODO(arv): This no longer matches the spec.
if (select[0] === ':' && !allowedPseudoRegExp.test(select))
return false;

Expand Down
2 changes: 1 addition & 1 deletion src/wrappers/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
* @private
*/
this.previousSibling_ = undefined;
};
}

var OriginalDocumentFragment = window.DocumentFragment;
var originalAppendChild = OriginalNode.prototype.appendChild;
Expand Down

0 comments on commit 4f091bb

Please sign in to comment.