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

Side by Side Diff: third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html

Issue 1855823003: Implement Node.isConnected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change inDocument to inShadowIncludingDocument Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src='../resources/testharness.js'></script>
3 <script src='../resources/testharnessreport.js'></script>
4 <div id="log"></div>
5 <div id="host"></div>
6 <script>
7
8 var host = document.getElementById('host');
9
10 test(function() {
11 var orphan1 = document.createElement('div');
12 assert_false(orphan1.isConnected);
13 host.appendChild(orphan1);
14 assert_true(orphan1.isConnected);
15 }, 'When detached, isConnected should be false. When inserted into a document tr ee, isConnected should be true.');
16
17 test(function() {
18 host.attachShadow({mode: 'open'});
19 var orphan2 = document.createElement('div');
20 assert_false(orphan2.isConnected);
21 host.shadowRoot.appendChild(orphan2);
22 assert_true(orphan2.isConnected);
23 }, 'When inserted into a connected shadow tree, isConnected should be true.');
24
25 test(function() {
26 var orphan3 = document.createElement('div');
27 var host2 = document.createElement('div');
28 host2.attachShadow({mode: 'open'});
29 host2.shadowRoot.appendChild(orphan3);
30 assert_false(host2.isConnected);
31 assert_false(host2.shadowRoot.isConnected);
32 assert_false(orphan3.isConnected);
33 }, 'When inserted into a detached tree, isConnected should be false.');
34
35 test(function() {
36 var orphan4 = document.createElement('div');
37 var host3 = document.createElement('div');
38 var host4 = document.createElement('div');
39 host3.attachShadow({mode: 'open'});
40 host4.attachShadow({mode: 'open'});
41 host4.shadowRoot.appendChild(orphan4);
42 host3.shadowRoot.appendChild(host4);
43 assert_false(host3.isConnected);
44 assert_false(host3.shadowRoot.isConnected);
45 assert_false(host4.isConnected);
46 assert_false(host4.shadowRoot.isConnected);
47 assert_false(orphan4.isConnected);
48 host.appendChild(host3);
49 assert_true(host3.isConnected);
50 assert_true(host3.shadowRoot.isConnected);
51 assert_true(host4.isConnected);
52 assert_true(host4.shadowRoot.isConnected);
53 assert_true(orphan4.isConnected);
54 }, 'When detached, isConnected should be false. When a shadow tree inserted into a document tree, isConnected should be true');
55
56 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698