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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/remove-element.html

Issue 2241183002: CustomElements: each custom descendant should invoke (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Custom Elements: Remove an element</title>
3 <link rel="help" href="https://dom.spec.whatwg.org/#concept-node-remove">
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 // 15. For each shadow-including descendant descendant of node, in shadow-includ ing tree order,
12 // run these substeps:
13 // 2. If descendant is custom, then enqueue a custom element callback reaction with descendant,
14 // callback name "disconnectedCallback", and an empty argument list.
15 test_with_window((w) => {
16 w.document.body.innerHTML = `
17 <a-a id="a">
18 <p>
19 <a-a id="b"></a-a>
20 <a-a id="c"></a-a>
21 </p>
22 <a-a id="d"></a-a>
23 </a-a>`;
24 let invocations = [];
25 class X extends w.HTMLElement {
26 disconnectedCallback() { invocations.push(this); }
27 }
28 w.customElements.define('a-a', X);
29 w.document.getElementById("a").remove();
30 assert_array_equals(['a', 'b', 'c', 'd'], invocations.map((e) => e.id),
31 'four elements should have been removed in doc order');
32 },'Remove an element');
33 </script>
34 </body>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698