Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/dom/Node/treeRoot.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/treeRoot.html b/third_party/WebKit/LayoutTests/fast/dom/Node/treeRoot.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e063baa05cf88e6718657e50eef998845bbbafe5 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/treeRoot.html |
| @@ -0,0 +1,36 @@ |
| +<!DOCTYPE html> |
| +<html> |
|
kochi
2016/01/27 09:18:49
You can omit <html><head><body> (and their closing
yuzuchan
2016/01/28 06:23:56
Done.
|
| +<head> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +</head> |
| +<body> |
| +This test case verifies if Node.treeRoot works as expected. |
| +<div id='host-parent'> |
|
kochi
2016/01/27 09:18:49
Please use consistent quotes as in other places.
D
yuzuchan
2016/01/28 06:23:56
On 2016/01/27 09:18:49, kochi wrote:
> Please use
|
| + <div id='host'> |
| + </div> |
| +</div> |
| +<script> |
| + |
| +var hostParent = document.getElementById('host-parent'); |
| +var host = document.getElementById('host'); |
| +host.attachShadow({mode: 'open'}); |
| +var root = host.shadowRoot; |
|
kochi
2016/01/27 09:18:49
You can merge the 2 lines above, as
var root = hos
yuzuchan
2016/01/28 06:23:56
Done.
|
| +var child = document.createElement('div'); |
| +var grandchild = document.createElement('div'); |
| +child.setAttribute('id', 'child'); |
| +grandchild.setAttribute('id', 'grandchild'); |
| +root.appendChild(child); |
| +child.appendChild(grandchild); |
| + |
| +test(function() { |
| + assert_equals(document.treeRoot, document); |
| + assert_equals(hostParent.treeRoot, document); |
| + assert_equals(host.treeRoot, document); |
| + assert_equals(root.treeRoot, root); |
| + assert_equals(child.treeRoot, root); |
| + assert_equals(grandchild.treeRoot, root); |
| +}, "Node.treeRoot returns a root of the tree that the node belongs to, or the shadow root if the tree is a shadow tree."); |
|
kochi
2016/01/27 09:18:49
Use single quotes.
yuzuchan
2016/01/28 06:23:56
Done.
|
| +</script> |
| +</body> |
| +</html> |