OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Custom Elements: Changes to the HTML parser</title> |
| 5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"> |
| 6 <meta name="assert" content="HTML parser must construct custom elements inside d
ocument.write"> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/#create-an-element-for-the-t
oken"> |
| 8 <link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element"> |
| 9 <link rel="help" href="https://html.spec.whatwg.org/#document.write()"> |
| 10 <script src="/resources/testharness.js"></script> |
| 11 <script src="/resources/testharnessreport.js"></script> |
| 12 </head> |
| 13 <body> |
| 14 <div id="log"></div> |
| 15 <script> |
| 16 |
| 17 class MyCustomElement extends HTMLElement { } |
| 18 customElements.define('my-custom-element', MyCustomElement); |
| 19 |
| 20 document.write('<my-custom-element></my-custom-element>'); |
| 21 |
| 22 test(function () { |
| 23 var instance = document.querySelector('my-custom-element'); |
| 24 |
| 25 assert_true(instance instanceof HTMLElement); |
| 26 assert_true(instance instanceof MyCustomElement); |
| 27 |
| 28 }, 'HTML parser must instantiate custom elements inside document.write'); |
| 29 |
| 30 </script> |
| 31 </body> |
| 32 </html> |
OLD | NEW |