<body> <div id="test"> </div> <script> var div = document.getElementById("test"); var shadow1 = new WebKitShadowRoot(div); shadow1.innerHTML = "<div id='E'></div>"; var e = shadow1.getElementById("E"); var shadow2 = new WebKitShadowRoot(e); shadow2.innerHTML = "<div id='F'></div>"; var f = shadow2.getElementById("F"); var shadow3 = new WebKitShadowRoot(f); shadow3.innerHTML = "<div id='G'></div>"; </script> </body> The shadow1, shadow2, and shadow3's parentTreeScope() are the same as document(). If creating the same DOM tree by using the following script, parentTreeScope() returns correct parent tree scope. <script> var f = document.createElement("div"); var shadow3 = new WebKitShadowRoot(f); shadow3.innerHTML = "<div id='G'></div>"; var e = document.createElement("div"); var shadow2 = new WebKitShadowRoot(e); shadow2.appendChild(f); var test = document.getElementById("test"); var shadow1 = new WebKitShadowRoot(test); shadow1.appendChild(e); </script>
Created attachment 147770 [details] Patch
Looks sane for me, wait for the reviewers' comment!
Comment on attachment 147770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147770&action=review > Source/WebCore/testing/Internals.cpp:208 > +Node* Internals::parentTreeScopeRootNode(Node* node, ExceptionCode& ec) Why not just pass a TreeScope and make this parentScope() or something? I hope Internals APIs be a set of thin wrappers of private DOM API to make them orthogonal.
Comment on attachment 147770 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=147770&action=review >> Source/WebCore/testing/Internals.cpp:208 >> +Node* Internals::parentTreeScopeRootNode(Node* node, ExceptionCode& ec) > > Why not just pass a TreeScope and make this parentScope() or something? > I hope Internals APIs be a set of thin wrappers of private DOM API to make them orthogonal. Is TreeScope available from JS...?
Created attachment 148952 [details] Patch
Comment on attachment 148952 [details] Patch Clearing flags on attachment: 148952 Committed r121027: <http://trac.webkit.org/changeset/121027>
All reviewed patches have been landed. Closing bug.
*** Bug 89694 has been marked as a duplicate of this bug. ***