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

Unified Diff: LayoutTests/fast/dom/script-remove-child-id-map.html

Issue 418133003: Call insertedInto or removedFrom before childrenChanged (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix option elements. Created 6 years, 5 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 | LayoutTests/fast/dom/script-remove-child-id-map-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/script-remove-child-id-map.html
diff --git a/LayoutTests/fast/dom/script-remove-child-id-map.html b/LayoutTests/fast/dom/script-remove-child-id-map.html
new file mode 100644
index 0000000000000000000000000000000000000000..bd648c8a87a2b7d003614540db6e8b5c94dd00ca
--- /dev/null
+++ b/LayoutTests/fast/dom/script-remove-child-id-map.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+
+<script src="../../resources/js-test.js"></script>
+
+<script>
+description("Passes if it doesn't crash and the child is not in the id map");
+
+var script = document.createElement("script");
+script.type = "dont-execute";
+script.textContent = "script.remove()";
+child = document.createElement("div");
+child.id = "child";
+script.appendChild(child);
+
+// The script won't execute here because the type is invalid, but it also won't
+// get marked as being already run, so changing the children later will run it.
+document.documentElement.appendChild(script);
+
+// Per the spec setting the type has no effect
+script.type = "";
+
+// but changing the children *will* execute the script now that the type is
+// is valid.
+child.remove();
+
+child = null;
+gc();
+
+shouldBeNull("document.getElementById('child')");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/script-remove-child-id-map-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698