4 <title>Custom element constructor sets local namespace to the namespace from custom element definition</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="Custom element constructor sets custom element namespace to the namespace in custom element definition">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custom-elements">
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">
17 var doc = newHTMLDocument();
18 var GeneratedConstructor = doc.registerElement('x-a');
19 var customElement = new GeneratedConstructor();
20 assert_equals(customElement.namespaceURI, HTML_NAMESPACE,
21 'Custom element namespace should be equal to namespace in custom element definition');
22 }, 'Custom element constructor sets namespace to the namespace from custom element definition');
26 var doc = newHTMLDocument();
27 HTML5_ELEMENTS.forEach(function(tagName) {
28 var obj = doc.createElement(tagName);
29 var name = 'x-b-' + tagName;
30 var proto = Object.create(obj.constructor.prototype);
31 var GeneratedConstructor = doc.registerElement(name, {
35 var customElement = new GeneratedConstructor();
37 assert_equals(customElement.namespaceURI, HTML_NAMESPACE,
38 'Custom element namespace should be equal to namespace in custom element definition');
40 }, 'Custom element constructor sets namespace to the namespace from custom element definition. ' +
41 'Test constructor of extended HTML element');