OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>Custom Elements: Insert a node should try to upgrade</title> | |
3 <script src="../../resources/testharness.js"></script> | |
4 <script src="../../resources/testharnessreport.js"></script> | |
5 <script src="resources/custom-elements-helpers.js"></script> | |
6 <body> | |
7 <script> | |
8 'use strict'; | |
9 | |
10 // Insert a node | |
11 // https://dom.spec.whatwg.org/#concept-node-insert | |
12 // 6.5.2.2. try to upgrade inclusiveDescendant. | |
13 // Try to upgrade an element | |
14 // https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade | |
15 | |
dominicc (has gone to gerrit)
2016/06/16 05:26:41
Delete this line?
| |
16 test_with_window(w => { | |
17 let element = w.document.createElement('a-a'); | |
18 assert_false(element.matches(':defined')); | |
dominicc (has gone to gerrit)
2016/06/16 05:26:41
This is a bit redundant given line 24?
| |
19 | |
20 w.customElements.define('a-a', class extends w.HTMLElement { | |
21 constructor() { super(); this.is_upgraded = true; } | |
dominicc (has gone to gerrit)
2016/06/16 05:26:41
Any reason not to write this over multiple lines?
| |
22 }); | |
23 assert_false('is_upgraded' in element); | |
24 assert_false(element.matches(':defined')); | |
25 | |
26 w.document.body.appendChild(element); | |
27 assert_true(element.is_upgraded); | |
28 assert_true(element.matches(':defined')); | |
29 | |
dominicc (has gone to gerrit)
2016/06/16 05:26:41
Delete this line?
| |
30 }, 'Insert a node should try to upgrade'); | |
31 </script> | |
32 </body> | |
OLD | NEW |