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

Unified Diff: LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html

Issue 1283263002: parserInsertBefore: Bail out if the parent no longer contains the child. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed the failing test Created 5 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 | LayoutTests/fast/parser/scriptexec-during-parserInsertBefore-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html
diff --git a/LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html b/LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html
new file mode 100644
index 0000000000000000000000000000000000000000..4e5a4db131380945ff4fadf31928e639ef7231fe
--- /dev/null
+++ b/LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<body>
+<div><i></i><table><b><p><iframe></iframe><script>
+/*
+The adoption agency algorithm, step 10, will end up calling
+ContainerNode::parserInsertBefore with the following arguments:
+
+|this| == <div>
+|newChild| == <p>
+|nextChild| == <table>
+
+parserInsertBefore calls parserRemoveChild(newChild), which
+triggers the unload event in the contained iframe.
+*/
+
+var containerNode = document.querySelector("div");
+var firstChild = document.querySelector("i");
+var nextChild = document.querySelector("table");
+
+frames[0].onunload = function() {
+ containerNode.removeChild(nextChild);
+}
+</script></b></p><!--This order is intentional to force reparenting--></table></div>
+<script>
+description("Ensure that DOM is consistent after a specific child has been removed during reparenting.")
+shouldBe("containerNode.firstChild", "firstChild");
+shouldBe("nextChild.previousSibling", "null");
+</script>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/parser/scriptexec-during-parserInsertBefore-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698