| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Instantiation of custom element: custom element type is given via the loc
al name of the custom element</title> |
| 5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> |
| 6 <meta name="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru
"> |
| 7 <meta name="assert" content="The custom element type is given to a custom elemen
t at the time of its instantation in one of the two ways: 1. As the local name o
f the custom element."> |
| 8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custo
m-elements"> |
| 9 <script src="../../../../resources/testharness.js"></script> |
| 10 <script src="../../../../resources/testharnessreport.js"></script> |
| 11 <script src="../testcommon.js"></script> |
| 12 <link rel="stylesheet" href="../../../../resources/testharness.css"> |
| 13 </head> |
| 14 <body> |
| 15 <div id="log"></div> |
| 16 <script> |
| 17 test(function() { |
| 18 var doc = newHTMLDocument(); |
| 19 var GeneratedConstructor = doc.registerElement('x-a'); |
| 20 doc.body.innerHTML = '<x-a id="x-a"></x-a>'; |
| 21 var customElement = doc.querySelector('#x-a'); |
| 22 assert_equals(Object.getPrototypeOf(customElement), GeneratedConstructor.pro
totype, |
| 23 'Custom element type should be the type, specified by the local name of
' + |
| 24 'the custom element'); |
| 25 }, 'Test custom element type, which is given via the local name of the custom el
ement. ' + |
| 26 'Custom element created via innerHTML property'); |
| 27 |
| 28 |
| 29 testInIFrame('../resources/x-element.html', function(doc) { |
| 30 var GeneratedConstructor = doc.registerElement('x-element'); |
| 31 var xelement = doc.querySelector('#x-element'); |
| 32 assert_equals(Object.getPrototypeOf(xelement), GeneratedConstructor.prototyp
e, |
| 33 'Custom element type should be the type, specified by the local name of
' + |
| 34 'the custom element'); |
| 35 }, 'Test custom element type, which is given via the local name of the custom el
ement. ' + |
| 36 'Custom element is defined in loaded HTML document'); |
| 37 </script> |
| 38 </body> |
| 39 </html> |
| OLD | NEW |