| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Document.createElement() and Document.createElementNS() create custom ele
ment of type, specified by localName argument</title> |
| 5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> |
| 6 <meta name="assert" content="If an element definition with matching localName, n
amespace, and TYPE is not registered with token's document, set TYPE to localNam
e"> |
| 7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#extensions-to-docum
ent-interface-to-instantiate"> |
| 8 <script src="../../../../../resources/testharness.js"></script> |
| 9 <script src="../../../../../resources/testharnessreport.js"></script> |
| 10 <script src="../../testcommon.js"></script> |
| 11 <link rel="stylesheet" href="../../../../../resources/testharness.css"> |
| 12 </head> |
| 13 <body> |
| 14 <div id="log"></div> |
| 15 <script> |
| 16 test(function() { |
| 17 var doc = newHTMLDocument(); |
| 18 var name1 = 'x-a'; |
| 19 var name2 = 'x-b'; |
| 20 var GeneratedConstructor = doc.registerElement(name1); |
| 21 var customElement = doc.createElement(name1, name2); |
| 22 |
| 23 assert_equals(Object.getPrototypeOf(customElement), GeneratedConstructor.pro
totype, |
| 24 'Custom element type should be the local name of the custom element'); |
| 25 }, 'Test Document.createElement() creates custom element of type, ' + |
| 26 'specified by localName argument, if an element definition with matching loc
alName, ' + |
| 27 'namespace, and type is not registered'); |
| 28 |
| 29 |
| 30 test(function() { |
| 31 var doc = newHTMLDocument(); |
| 32 var name1 = 'x-c'; |
| 33 var name2 = 'x-d'; |
| 34 var GeneratedConstructor = doc.registerElement(name1); |
| 35 var customElement = doc.createElementNS(HTML_NAMESPACE, name1, name2); |
| 36 |
| 37 assert_equals(Object.getPrototypeOf(customElement), GeneratedConstructor.pro
totype, |
| 38 'Custom element type should be the local name of the custom element'); |
| 39 }, 'Test Document.createElementNS() creates custom element of type, ' + |
| 40 'specified by localName argument, if an element definition with matching ' + |
| 41 'localName, namespace, and type is not registered'); |
| 42 </script> |
| 43 </body> |
| 44 </html> |
| OLD | NEW |