OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Shadow DOM: Element interface shadowRoot attribute</title> | 4 <title>Shadow DOM: Element interface shadowRoot attribute</title> |
5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> | 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> |
6 <meta name="assert" content="shadowRoot attribute on Element interface must retu
rn the associated open shadow tree if there is one"> | 6 <meta name="assert" content="shadowRoot attribute on Element interface must retu
rn the associated open shadow tree if there is one"> |
7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-shad
owroot-interface"> | 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#the-shad
owroot-interface"> |
8 <script src="../../../resources/testharness.js"></script> | 8 <script src="../../../resources/testharness.js"></script> |
9 <script src="../../../resources/testharnessreport.js"></script> | 9 <script src="../../../resources/testharnessreport.js"></script> |
10 <link rel='stylesheet' href='../../../resources/testharness.css'> | |
11 </head> | 10 </head> |
12 <body> | 11 <body> |
13 <div id="log"></div> | 12 <div id="log"></div> |
14 <script> | 13 <script> |
15 | 14 |
16 test(function () { | 15 test(function () { |
17 assert_true('shadowRoot' in Element.prototype, 'shadowRoot must be defined o
n Element prototype'); | 16 assert_true('shadowRoot' in Element.prototype, 'shadowRoot must be defined o
n Element prototype'); |
18 assert_true('shadowRoot' in document.createElement('div'), 'shadowRoot must
be defined on an instance of div element'); | 17 assert_true('shadowRoot' in document.createElement('div'), 'shadowRoot must
be defined on an instance of div element'); |
19 assert_false('shadowRoot' in Node.prototype, 'shadowRoot must not be defined
on Node prototype'); | 18 assert_false('shadowRoot' in Node.prototype, 'shadowRoot must not be defined
on Node prototype'); |
20 assert_false('shadowRoot' in Text.prototype, 'shadowRoot must not be defined
on Text prototype'); | 19 assert_false('shadowRoot' in Text.prototype, 'shadowRoot must not be defined
on Text prototype'); |
(...skipping 16 matching lines...) Expand all Loading... |
37 | 36 |
38 test(function () { | 37 test(function () { |
39 var host = document.createElement('div'); | 38 var host = document.createElement('div'); |
40 host.attachShadow({mode: 'closed'}); | 39 host.attachShadow({mode: 'closed'}); |
41 assert_equals(host.shadowRoot, null); | 40 assert_equals(host.shadowRoot, null); |
42 }, 'shadowRoot attribute must return null if the shadow root attached to the ele
ment is closed'); | 41 }, 'shadowRoot attribute must return null if the shadow root attached to the ele
ment is closed'); |
43 | 42 |
44 </script> | 43 </script> |
45 </body> | 44 </body> |
46 </html> | 45 </html> |
OLD | NEW |