Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Custom Elements: Custom Element State "Failed" in Upgrades</title> | 2 <title>Custom Elements: Custom Element State "Failed" in Upgrades</title> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/custom-elements-helpers.js"></script> | 5 <script src="resources/custom-elements-helpers.js"></script> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 // Custom Element State | 10 // Custom Element State |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // 9. If constructResult is an abrupt completion, then | 29 // 9. If constructResult is an abrupt completion, then |
| 30 // Set element's custom element state to "failed". | 30 // Set element's custom element state to "failed". |
| 31 // https://html.spec.whatwg.org/multipage/scripting.html#upgrades | 31 // https://html.spec.whatwg.org/multipage/scripting.html#upgrades |
| 32 let container = document.body; | 32 let container = document.body; |
| 33 container.appendChild(element); | 33 container.appendChild(element); |
| 34 assert_equals(constructorCount, 1, 'constructor should be invoked once'); | 34 assert_equals(constructorCount, 1, 'constructor should be invoked once'); |
| 35 | 35 |
| 36 // "failed" is not "defined" | 36 // "failed" is not "defined" |
| 37 // https://dom.spec.whatwg.org/#concept-element-defined | 37 // https://dom.spec.whatwg.org/#concept-element-defined |
| 38 assert_false(element.matches(':defined')); | 38 assert_false(element.matches(':defined')); |
| 39 // "failed" element should implement HTMLUnknownElement only in "creating an e lement for a token" | |
| 40 // https://html.spec.whatwg.org/#create-an-element-for-the-token | |
| 41 assert_equals(Object.getPrototypeOf(element), w.HTMLElement.prototype); | |
|
kojii
2016/09/06 08:10:55
Replace this one to "instanceof" too?
dominicc (has gone to gerrit)
2016/09/06 16:54:07
I think the assert_equals checks are better becaus
| |
| 42 // 2. If element's custom element state is "failed", then abort these steps. | |
| 43 // https://html.spec.whatwg.org/multipage/scripting.html#upgrades | |
| 44 container.appendChild(element); | |
| 45 assert_equals(constructorCount, 1, 'constructor should be invoked once'); | |
| 39 }); | 46 }); |
| 40 </script> | 47 </script> |
| 41 </body> | 48 </body> |
| OLD | NEW |