Commit 5401b41c authored by hayato's avatar hayato Committed by Commit bot

Remove Node.rootNode

Before shipping Shadow DOM v1, we have to remove this feature because Node.rootNode
is guarded by ShadowDOMV1 flag.

See also https://bugs.chromium.org/p/chromium/issues/detail?id=608006.
Ship of Node.rootNode was reverted there.

BUG=531990

Review-Url: https://codereview.chromium.org/2106683002
Cr-Commit-Position: refs/heads/master@{#402697}
parent 45859e62
...@@ -48,7 +48,7 @@ PASS Node member must be nuked: isSupported ...@@ -48,7 +48,7 @@ PASS Node member must be nuked: isSupported
PASS Node member must be nuked: getFeature PASS Node member must be nuked: getFeature
PASS Node member must be nuked: getUserData PASS Node member must be nuked: getUserData
PASS Node member must be nuked: setUserData PASS Node member must be nuked: setUserData
FAIL Node member must be nuked: rootNode assert_equals: expected (undefined) undefined but got (object) Document node with 0 children PASS Node member must be nuked: rootNode
PASS Window member must be nuked: attachEvent PASS Window member must be nuked: attachEvent
Harness: the test ran to completion. Harness: the test ran to completion.
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div id="host-parent">
<div id="host">
</div>
<div id="slotted"></div>
</div>
<div id="host-parent2">
<div id="host2">
</div>
<div id="distributed" id="distributed"></div>
</div>
<script>
var hostParent = document.getElementById('host-parent');
var host = document.getElementById('host');
var slotted = document.getElementById('slotted');
var root = host.attachShadow({mode: 'open'});
var child = document.createElement('div');
var grandchild = document.createElement('div');
var slot = document.createElement('slot');
slot.setAttribute('name', 'slot');
slotted.setAttribute('slot', 'slot');
child.setAttribute('id', 'child');
grandchild.setAttribute('id', 'grandchild');
root.appendChild(child);
child.appendChild(grandchild);
grandchild.appendChild(slot);
test(function() {
assert_equals(document.rootNode, document);
assert_equals(hostParent.rootNode, document);
assert_equals(host.rootNode, document);
assert_equals(root.rootNode, root);
assert_equals(child.rootNode, root);
assert_equals(grandchild.rootNode, root);
assert_equals(slot.rootNode, root);
assert_equals(slotted.rootNode, document);
}, 'Node.rootNode returns a root of the tree that the node belongs to, or the shadow root if the tree is a shadow tree.');
test(function() {
var nestedChild = document.createElement('div');
var nestedRoot = grandchild.attachShadow({mode: 'open'});
nestedRoot.appendChild(nestedChild);
assert_equals(nestedRoot.rootNode, nestedRoot);
assert_equals(nestedChild.rootNode, nestedRoot);
}, 'Node.rootNode works with a nested shadow tree.');
test(function() {
var detached = document.createElement('div');
var detachedChild = document.createElement('div');
detached.appendChild(detachedChild);
assert_equals(detached.rootNode, detached);
assert_equals(detachedChild.rootNode, detached);
}, 'Node.rootNode works with a detached tree as well.');
test(function() {
var hostParent2 = document.getElementById('host-parent2');
var host2 = document.getElementById('host2');
var distributed = document.getElementById('distributed');
var root2 = host2.createShadowRoot();
var child2 = document.createElement('div');
var grandchild2 = document.createElement('div');
var content = document.createElement('content');
content.setAttribute('select', '#distributed');
child2.setAttribute('id', 'child2');
grandchild2.setAttribute('id', 'grandchild2');
root2.appendChild(child2);
child2.appendChild(grandchild2);
grandchild2.appendChild(content);
assert_equals(hostParent2.rootNode, document);
assert_equals(host2.rootNode, document);
assert_equals(root2.rootNode, root2);
assert_equals(child2.rootNode, root2);
assert_equals(grandchild2.rootNode, root2);
assert_equals(content.rootNode, root2);
assert_equals(distributed.rootNode, document);
}, 'Node.rootNode works with a v0 shadow tree as well.');
</script>
...@@ -216,7 +216,6 @@ namespace http://www.w3.org/1999/xhtml ...@@ -216,7 +216,6 @@ namespace http://www.w3.org/1999/xhtml
property replaceWith property replaceWith
property requestFullscreen property requestFullscreen
property requestPointerLock property requestPointerLock
property rootNode
property scroll property scroll
property scrollBy property scrollBy
property scrollHeight property scrollHeight
...@@ -1321,7 +1320,6 @@ namespace http://www.w3.org/2000/svg ...@@ -1321,7 +1320,6 @@ namespace http://www.w3.org/2000/svg
property replaceWith property replaceWith
property requestFullscreen property requestFullscreen
property requestPointerLock property requestPointerLock
property rootNode
property scroll property scroll
property scrollBy property scrollBy
property scrollHeight property scrollHeight
......
...@@ -4047,7 +4047,6 @@ interface Node : EventTarget ...@@ -4047,7 +4047,6 @@ interface Node : EventTarget
getter parentElement getter parentElement
getter parentNode getter parentNode
getter previousSibling getter previousSibling
getter rootNode
getter textContent getter textContent
method appendChild method appendChild
method cloneNode method cloneNode
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
[PerWorldBindings] readonly attribute Node? lastChild; [PerWorldBindings] readonly attribute Node? lastChild;
[PerWorldBindings] readonly attribute Node? previousSibling; [PerWorldBindings] readonly attribute Node? previousSibling;
[PerWorldBindings] readonly attribute Node? nextSibling; [PerWorldBindings] readonly attribute Node? nextSibling;
[RuntimeEnabled=ShadowDOMV1, MeasureAs=NodeRootNode, ImplementedAs=treeRoot] readonly attribute Node rootNode;
[CEReactions, CustomElementCallbacks] attribute DOMString? nodeValue; [CEReactions, CustomElementCallbacks] attribute DOMString? nodeValue;
......
...@@ -961,7 +961,6 @@ public: ...@@ -961,7 +961,6 @@ public:
MediaStreamConstraintsFromDictionary = 1151, MediaStreamConstraintsFromDictionary = 1151,
MediaStreamConstraintsConformant = 1152, MediaStreamConstraintsConformant = 1152,
CSSSelectorIndirectAdjacent = 1153, CSSSelectorIndirectAdjacent = 1153,
NodeRootNode = 1154,
CreateImageBitmap = 1156, CreateImageBitmap = 1156,
PresentationConnectionConnectEventListener = 1157, PresentationConnectionConnectEventListener = 1157,
PresentationConnectionCloseEventListener = 1158, PresentationConnectionCloseEventListener = 1158,
......
...@@ -75699,7 +75699,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -75699,7 +75699,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<int value="1151" label="MediaStreamConstraintsFromDictionary"/> <int value="1151" label="MediaStreamConstraintsFromDictionary"/>
<int value="1152" label="MediaStreamConstraintsConformant"/> <int value="1152" label="MediaStreamConstraintsConformant"/>
<int value="1153" label="CSSSelectorIndirectAdjacent"/> <int value="1153" label="CSSSelectorIndirectAdjacent"/>
<int value="1154" label="NodeRootNode"/> <int value="1154" label="NodeRootNode (obsolete)"/>
<int value="1155" label="BluetoothDeviceConnectGATT"/> <int value="1155" label="BluetoothDeviceConnectGATT"/>
<int value="1156" label="CreateImageBitmap"/> <int value="1156" label="CreateImageBitmap"/>
<int value="1157" label="PresentationConnectionConnectEventListener"/> <int value="1157" label="PresentationConnectionConnectEventListener"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment