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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/registering-custom-elements/definition-construction-algorithm-default-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>Default namespace is HTML namespace</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="Default namespace is HTML namespace">
7 <link rel="help" href="http://www.w3.org/TR/custom-elements/#registering-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">
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
21 assert_equals(customElement.namespaceURI, HTML_NAMESPACE,
22 'Custom element namespace should be HTML namespace');
23 }, 'Default namespace is HTML namespace');
24
25
26 test(function() {
27 var doc = newHTMLDocument();
28 HTML5_ELEMENTS.forEach(function(tagName) {
29 var obj = doc.createElement(tagName);
30 var name = 'x-b-' + tagName;
31 var proto = Object.create(obj.constructor.prototype);
32 var GeneratedConstructor = doc.registerElement(name, {
33 prototype: proto,
34 extends: tagName
35 });
36 var customElement = new GeneratedConstructor();
37
38 assert_equals(customElement.namespaceURI, HTML_NAMESPACE,
39 'Custom element namespace should be HTML namespace');
40 });
41 }, 'Default namespace is HTML namespace. Test constructor of extended HTML eleme nt');
42 </script>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698