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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch update Created 4 years, 4 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 <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
11 // 3.2 For each inclusiveDescendant in node’s shadow-including inclusive descend ants that is a custom
12 // element, enqueue a custom element callback reaction with inclusiveDescendant,
13 // callback name "adoptedCallback", and an empty argument list.
14 promise_test((t) => {
15 return Promise.all([
16 create_window_in_test(t),
17 create_window_in_test(t)])
18 .then(([w1, w2]) => {
19 let invocations = [];
20 class X extends w1.HTMLElement {
21 constructor() { super(); }
22 adoptedCallback() { invocations.push(['adopted', this, []]); }
23 }
24 w1.customElements.define('a-a', X);
25 let a = w1.document.createElement('a-a');
26 w2.document.adoptNode(a);
27 assert_array_equals_callback_invocations(invocations, [ ['adopted', a, []] ]);
28 });
29 }, 'adopting a custom element to the different document should enqueue an adopte dCallback reaction');
30 </script>
31 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698