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

Side by Side Diff: LayoutTests/imported/web-platform-tests/custom-elements/instantiating-custom-elements/extensions-to-document-interface/create-element-is-attribute.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>Document.createElement() and Document.createElementNS() set IS attribute to type</title>
5 <meta name="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
6 <meta name="assert" content="If TYPE is not the same as localName, set the value of ELEMENT's IS attribute to TYPE">
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 HTML5_ELEMENTS.forEach(function(tagName) {
19 var obj = doc.createElement(tagName);
20 var name = 'x-a-' + tagName;
21 var proto = Object.create(obj.constructor.prototype);
22 doc.registerElement(name, {prototype: proto, extends: tagName});
23 var customElement = doc.createElement(tagName, name);
24 assert_equals(customElement.getAttribute('is'), name,
25 'Value of the IS attribute should be set to type by Document.createE lement()');
26 });
27 }, 'Test Document.createElement() sets the element\'s IS attribute value to type , ' +
28 'if type is not the same as localName');
29
30
31 test(function() {
32 var doc = newHTMLDocument();
33 HTML5_ELEMENTS.forEach(function(tagName) {
34 var name = 'x-b-' + tagName;
35 var customElement = doc.createElement(tagName, name);
36 assert_equals(customElement.getAttribute('is'), name,
37 'Value of the IS attribute should be set to type by Document.createE lement()');
38 });
39 }, 'Test Document.createElement() sets the element\'s IS attribute value to type , ' +
40 'if type is not the same as localName and an element definition with matchin g ' +
41 'localName, namespace, and type is not registered');
42
43
44 test(function() {
45 var doc = newHTMLDocument();
46 HTML5_ELEMENTS.forEach(function(tagName) {
47 var obj = doc.createElement(tagName);
48 var name = 'x-c-' + tagName;
49 var proto = Object.create(obj.constructor.prototype);
50 doc.registerElement(name, {prototype: proto, extends: tagName});
51 var customElement = doc.createElementNS(HTML_NAMESPACE, tagName, name);
52 assert_equals(customElement.getAttribute('is'), name,
53 'Value of the IS attribute should be set to type by Document.createE lementNS()');
54 });
55 }, 'Test Document.createElementNS() sets the element\'s IS attribute value to ty pe, ' +
56 'if type is not the same as localName');
57
58
59 test(function() {
60 var doc = newHTMLDocument();
61 HTML5_ELEMENTS.forEach(function(tagName) {
62 var name = 'x-d-' + tagName;
63 var customElement = doc.createElementNS(HTML_NAMESPACE, tagName, name);
64 assert_equals(customElement.getAttribute('is'), name,
65 'Value of the IS attribute should be set to type by Document.createE lementNS()');
66 });
67 }, 'Test Document.createElementNS() sets the element\'s IS attribute value to ty pe, ' +
68 'if type is not the same as localNameand and an element definition with matc hing ' +
69 'localName, namespace, and type is not registered ');
70 </script>
71 </body>
72 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698