| Index: third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html
|
| diff --git a/third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html b/third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cb6972e9090cedb9b6579fb8deec2ce352182840
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/shadow-dom/node-isConnected.html
|
| @@ -0,0 +1,38 @@
|
| +<!DOCTYPE html>
|
| +<script src='../resources/testharness.js'></script>
|
| +<script src='../resources/testharnessreport.js'></script>
|
| +<script src='../fast/dom/shadow/resources/shadow-dom.js'></script>
|
| +<script src='resources/shadow-dom.js'></script>
|
| +<div id="log"></div>
|
| +<div id="host"></div>
|
| +<script>
|
| +
|
| +var host = document.getElementById('host');
|
| +host.attachShadow({mode: 'open'});
|
| +var orphan1 = document.createElement('div');
|
| +
|
| +test(function() {
|
| + assert_false(orphan1.isConnected);
|
| +}, 'isConnected of detached node should be false.');
|
| +
|
| +test(function() {
|
| + host.shadowRoot.appendChild(orphan1);
|
| + assert_true(orphan1.isConnected);
|
| +}, 'When inserted into a connected shadow tree, isConnected should be true.');
|
| +
|
| +
|
| +test(function() {
|
| + var orphan2 = document.createElement('div');
|
| + host.appendChild(orphan2);
|
| + assert_true(orphan2.isConnected);
|
| +}, 'When inserted into a document tree, isConnected should be true.');
|
| +
|
| +test(function() {
|
| + var orphan3 = document.createElement('div');
|
| + var host2 = document.createElement('div');
|
| + host2.attachShadow({mode: 'open'});
|
| + host2.shadowRoot.appendChild(orphan3);
|
| + assert_false(orphan3.isConnected);
|
| +}, 'When inserted into a detached tree, isConnected should be false.');
|
| +
|
| +</script>
|
|
|