Chromium Code Reviews| OLD | NEW |
|---|---|
| (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> | |
| OLD | NEW |