Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Node/treeRoot.html

Issue 1642503002: Implement Node.treeRoot (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <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.
3 <head>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 This test case verifies if Node.treeRoot works as expected.
9 <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
10 <div id='host'>
11 </div>
12 </div>
13 <script>
14
15 var hostParent = document.getElementById('host-parent');
16 var host = document.getElementById('host');
17 host.attachShadow({mode: 'open'});
18 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.
19 var child = document.createElement('div');
20 var grandchild = document.createElement('div');
21 child.setAttribute('id', 'child');
22 grandchild.setAttribute('id', 'grandchild');
23 root.appendChild(child);
24 child.appendChild(grandchild);
25
26 test(function() {
27 assert_equals(document.treeRoot, document);
28 assert_equals(hostParent.treeRoot, document);
29 assert_equals(host.treeRoot, document);
30 assert_equals(root.treeRoot, root);
31 assert_equals(child.treeRoot, root);
32 assert_equals(grandchild.treeRoot, root);
33 }, "Node.treeRoot returns a root of the tree that the node belongs to, or the sh adow 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.
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Node.h » ('j') | third_party/WebKit/Source/core/dom/Node.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698