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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/custom-elements/spec/remove-element.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/remove-element.html b/third_party/WebKit/LayoutTests/custom-elements/spec/remove-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..58d376115b1fdd272668147003c09f6de544a04f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/remove-element.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Custom Elements: Remove an element</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-remove">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="resources/custom-elements-helpers.js"></script>
+<body>
+<script>
+'use strict';
+
+// 15. For each shadow-including descendant descendant of node, in shadow-including tree order,
+// run these substeps:
+// 2. If descendant is custom, then enqueue a custom element callback reaction with descendant,
+// callback name "disconnectedCallback", and an empty argument list.
+test_with_window((w) => {
+ w.document.body.innerHTML = `
+<a-a id="a">
+ <p>
+ <a-a id="b"></a-a>
+ <a-a id="c"></a-a>
+ </p>
+ <a-a id="d"></a-a>
+</a-a>`;
+ let invocations = [];
+ class X extends w.HTMLElement {
+ disconnectedCallback() { invocations.push(this); }
+ }
+ w.customElements.define('a-a', X);
+ w.document.getElementById("a").remove();
+ assert_array_equals(['a', 'b', 'c', 'd'], invocations.map((e) => e.id),
+ 'four elements should have been removed in doc order');
+},'Remove an element');
+</script>
+</body>
« 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