OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>Custom Elements: adopt node</title> | |
3 <link rel="help" href="https://dom.spec.whatwg.org/#concept-node-adopt"> | |
4 <script src="../../resources/testharness.js"></script> | |
5 <script src="../../resources/testharnessreport.js"></script> | |
6 <script src="resources/custom-elements-helpers.js"></script> | |
7 <body> | |
8 <script> | |
9 'use strict' | |
10 // 3.2 For each inclusiveDescendant in node’s shadow-including inclusive descend ants that is a custom | |
11 // element, enqueue a custom element callback reaction with inclusiveDescendant, | |
12 // callback name "adoptedCallback", and an empty argument list. | |
13 promise_test((t) => { | |
14 return Promise.all([ | |
15 create_window_in_test(t), | |
dominicc (has gone to gerrit)
2016/07/28 02:45:59
Maybe indent these two lines, two spaces?
| |
16 create_window_in_test(t)]) | |
17 .then(([w1, w2]) => { | |
18 let invocations = []; | |
19 class X extends w1.HTMLElement { | |
20 constructor() { super(); } | |
21 adoptedCallback() { invocations.push('adopted'); } | |
22 } | |
23 w1.customElements.define('a-a', X); | |
24 let a = w1.document.createElement('a-a'); | |
25 w2.document.adoptNode(a); | |
26 // TODO(davaajav):write more specific assertion witj assert_array_equals_cal lback_invocations from helpers | |
dominicc (has gone to gerrit)
2016/07/28 02:45:59
spelling: with
| |
27 assert_array_equals(invocations, ['adopted']); | |
28 }); | |
29 }, 'adopting a custom element to the different document should enqueue an adopte dCallback reaction'); | |
30 </script> | |
31 </body> | |
OLD | NEW |