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

Commit

Permalink
Merge pull request #362 from arv/fix-ie-9-matches
Browse files Browse the repository at this point in the history
Fix IE9 issue with shadow tree composition
  • Loading branch information
dfreedm committed Jan 23, 2014
2 parents 76028bf + 4f091bb commit 0295a63
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 0295a63

Please sign in to comment.