Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/instantiating-custom-elements/custom-element-constructor-namespace.html

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Custom element constructor sets local namespace to the namespace from cus tom 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 name space to the namespace in custom element definition">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#instantiating-custo m-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">
12 </head>
13 <body>
14 <div id="log"></div>
15 <script>
16 test(function() {
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 eleme nt definition');
23
24
25 test(function() {
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, {
32 prototype: proto,
33 extends: tagName
34 });
35 var customElement = new GeneratedConstructor();
36
37 assert_equals(customElement.namespaceURI, HTML_NAMESPACE,
38 'Custom element namespace should be equal to namespace in custom ele ment definition');
39 });
40 }, 'Custom element constructor sets namespace to the namespace from custom eleme nt definition. ' +
41 'Test constructor of extended HTML element');
42 </script>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698