OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>Unresolved element interface must be HTMLElement, if the namespace is HTM
L Namespace</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="When an unresolved element is created, it's element
interface must be HTMLElement, if the namespace is HTML Namespace"> | |
8 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-custom-
elements"> | |
9 <script src="../../../../resources/testharness.js"></script> | |
10 <script src="../../../../resources/testharnessreport.js"></script> | |
11 <script src="../testcommon.js"></script> | |
12 </head> | |
13 <body> | |
14 <div id="log"></div> | |
15 <script> | |
16 test(function() { | |
17 var doc = newHTMLDocument(); | |
18 doc.body.innerHTML = '<x-a id="x-a"></x-a>'; | |
19 var customElement = doc.querySelector('#x-a'); | |
20 | |
21 assert_not_equals(customElement, null, 'Unregistered custom element should n
ot be null'); | |
22 | |
23 assert_class_string(customElement, 'HTMLElement', | |
24 'Unresolved custom element must be a HTML element'); | |
25 }, 'Test interface of unresolved element, created via innerHTML property'); | |
26 | |
27 | |
28 test(function() { | |
29 var doc = newHTMLDocument(); | |
30 var customElement = doc.createElement('x-b'); | |
31 | |
32 assert_class_string(customElement, 'HTMLElement', | |
33 'Unresolved custom element must be a HTML element'); | |
34 }, 'Test interface of unresolved element, created by Document.createElement'); | |
35 | |
36 | |
37 test(function() { | |
38 var doc = newHTMLDocument(); | |
39 var customElement = doc.createElementNS(HTML_NAMESPACE, 'x-c'); | |
40 | |
41 assert_class_string(customElement, 'HTMLElement', | |
42 'Unresolved custom element must be a HTML element'); | |
43 }, 'Test interface of unresolved element, created by Document.createElementNS'); | |
44 | |
45 | |
46 testInIFrame('../resources/x-element.html', function(doc) { | |
47 var customElement = doc.getElementById('x-element'); | |
48 | |
49 assert_not_equals(customElement, null, 'Unregistered custom element should n
ot be null'); | |
50 | |
51 assert_class_string(customElement, 'HTMLElement', | |
52 'Unresolved custom element must be a HTML element'); | |
53 }, 'Test unresolved element interface in loaded HTML document'); | |
54 </script> | |
55 </body> | |
56 </html> | |
OLD | NEW |