OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Shadow DOM: Attaching a ShadowRoot</title> | 4 <title>Shadow DOM: Attaching a ShadowRoot</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="Element.prototype.attachShadow should create an ins
tance of ShadowRoot"> | 6 <meta name="assert" content="Element.prototype.attachShadow should create an ins
tance of ShadowRoot"> |
7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#widl-Ele
ment-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict"> | 7 <link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#widl-Ele
ment-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict"> |
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('attachShadow' in Element.prototype, 'Element.prototype.attachSh
adow must exist'); | 16 assert_true('attachShadow' in Element.prototype, 'Element.prototype.attachSh
adow must exist'); |
18 assert_equals(typeof(document.createElement('div').attachShadow), 'function'
, 'An instance of div must have attachShadow which is a function'); | 17 assert_equals(typeof(document.createElement('div').attachShadow), 'function'
, 'An instance of div must have attachShadow which is a function'); |
19 }, 'Check the existence of Element.attachShadow'); | 18 }, 'Check the existence of Element.attachShadow'); |
20 | 19 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 85 |
87 assert_throws({'name': 'NotSupportedError'}, function () { | 86 assert_throws({'name': 'NotSupportedError'}, function () { |
88 document.createElement(elementName).attachShadow({mode: "closed"}); | 87 document.createElement(elementName).attachShadow({mode: "closed"}); |
89 }, 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' elemen
t must throw'); | 88 }, 'Calling attachShadow({mode: "closed"}) on ' + elementName + ' elemen
t must throw'); |
90 } | 89 } |
91 }, 'Element.attachShadow must throw a NotSupportedError for button, details, inp
ut, marquee, meter, progress, select, textarea, and keygen elements'); | 90 }, 'Element.attachShadow must throw a NotSupportedError for button, details, inp
ut, marquee, meter, progress, select, textarea, and keygen elements'); |
92 | 91 |
93 </script> | 92 </script> |
94 </body> | 93 </body> |
95 </html> | 94 </html> |
OLD | NEW |