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 #421 from arv/older-shadow-root-should-be-tree-sco…
Browse files Browse the repository at this point in the history
…pe-parent

The older shadow root should act as a parent tree scope
  • Loading branch information
Steve Orvell committed Apr 21, 2014
2 parents ea43716 + 769c74c commit 640ac89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/wrappers/ShadowRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
// DocumentFragment instance. Override that.
rewrap(node, this);

this.treeScope_ = new TreeScope(this, getTreeScope(hostWrapper));

var oldShadowRoot = hostWrapper.shadowRoot;
nextOlderShadowTreeTable.set(this, oldShadowRoot);

this.treeScope_ =
new TreeScope(this, getTreeScope(oldShadowRoot || hostWrapper));

shadowHostTable.set(this, hostWrapper);
}
ShadowRoot.prototype = Object.create(DocumentFragment.prototype);
Expand Down
2 changes: 1 addition & 1 deletion test/js/TreeScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ suite('TreeScope', function() {
assert.equal(ts1.parent, null);
assert.equal(ts2.parent, ts1);
assert.equal(ts3.parent, ts2);
assert.equal(ts4.parent, ts1);
assert.equal(ts4.parent, ts2);

var div2 = document.createElement('div');
div2.appendChild(a);
Expand Down

0 comments on commit 640ac89

Please sign in to comment.