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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/custom-elements/instantiating-custom-elements/unchanged-attribute.html

Issue 1962003002: Import web-platform-tests@41d6911b288a9624c249a406b9bf51607a2dd04d (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip submit-entity-body.html 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
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Custom element's type is immutable.</title>
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." >
6 <link rel="help" href="http://w3c.github.io/webcomponents/spec/custom/#instantia ting-custom-elements">
7 <script src="../../../../resources/testharness.js"></script>
8 <script src="../../../../resources/testharnessreport.js"></script>
9 <div id="log"></div>
10 <script type="text/javascript">
11 test(function() {
12 var CustomButton = document.registerElement('custom-button', {
13 prototype: Object.create(HTMLButtonElement.prototype),
14 extends: 'button'
15 });
16 var customButton = document.createElement('button', 'custom-button');
17
18 assert_true(customButton instanceof CustomButton,
19 'A custom element is of the custom element type after ' +
20 'instantiation');
21 customButton.setAttribute('is', 'dirty');
22 assert_equals('dirty', customButton.getAttribute('is'),
23 'An attribute must be changed by method "setAttribute"');
24
25 assert_true(customButton instanceof CustomButton,
26 'A custom element is of the original custom element type even ' +
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.');
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698