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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/custom-elements/v0/instantiating/unchanged-attribute.html

Issue 1984023002: Move web-platform-tests to wpt (part 1 of 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>Custom element's type is immutable.</title> 3 <title>Custom element's type is immutable.</title>
4 <meta name="author" title="Bon-Yong Lee" href="mailto:bylee78@gmail.com"> 4 <meta name="author" title="Bon-Yong Lee" href="mailto:bylee78@gmail.com">
5 <meta name="assert" content="After a custom element is instantiated, changing th e value of the is attribute must not affect this element's custom element type." > 5 <meta name="assert" content="After a custom element is instantiated, changing th e value of the is attribute must not affect this element's custom element type." >
6 <link rel="help" href="http://w3c.github.io/webcomponents/spec/custom/#instantia ting-custom-elements"> 6 <link rel="help" href="http://w3c.github.io/webcomponents/spec/custom/#instantia ting-custom-elements">
7 <script src="../../../../../resources/testharness.js"></script> 7 <script src="../../../../../resources/testharness.js"></script>
8 <script src="../../../../../resources/testharnessreport.js"></script> 8 <script src="../../../../../resources/testharnessreport.js"></script>
9 <div id="log"></div> 9 <div id="log"></div>
10 <script type="text/javascript"> 10 <script type="text/javascript">
11 test(function() { 11 test(function() {
12 var CustomButton = document.registerElement('custom-button', { 12 var CustomButton = document.registerElement('custom-button', {
13 prototype: Object.create(HTMLButtonElement.prototype), 13 prototype: Object.create(HTMLButtonElement.prototype),
14 extends: 'button' 14 extends: 'button'
15 }); 15 });
16 var customButton = document.createElement('button', 'custom-button'); 16 var customButton = document.createElement('button', 'custom-button');
17 17
18 assert_true(customButton instanceof CustomButton, 18 assert_true(customButton instanceof CustomButton,
19 'A custom element is of the custom element type after ' + 19 'A custom element is of the custom element type after ' +
20 'instantiation'); 20 'instantiation');
21 customButton.setAttribute('is', 'dirty'); 21 customButton.setAttribute('is', 'dirty');
22 assert_equals('dirty', customButton.getAttribute('is'), 22 assert_equals('dirty', customButton.getAttribute('is'),
23 'An attribute must be changed by method "setAttribute"'); 23 'An attribute must be changed by method "setAttribute"');
24 24
25 assert_true(customButton instanceof CustomButton, 25 assert_true(customButton instanceof CustomButton,
26 'A custom element is of the original custom element type even ' + 26 'A custom element is of the original custom element type even ' +
27 'after changing the \'is\' attribute'); 27 'after changing the \'is\' attribute');
28 }, 'After a custom element is instantiated, changing the value of the is attribu te must not affect this element\'s custom element type.'); 28 }, 'After a custom element is instantiated, changing the value of the is attribu te must not affect this element\'s custom element type.');
29 </script> 29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698