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..0fa2cd1bf5f4704bd0b4d12133dc05ffc6061a94 |
--- /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> |
+/** |
esprehn
2015/08/12 19:42:19
single star
|
+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. |
+**/ |
esprehn
2015/08/12 19:42:19
ditto
|
+ |
+var containerNode = document.querySelector('div'); |
+var firstChild = document.querySelector('i'); |
esprehn
2015/08/12 19:42:18
double quotes for all these
|
+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.childNodes[0]", "firstChild"); |
esprehn
2015/08/12 19:42:18
.firstChild
|
+shouldBe("nextChild.previousSibling", "null"); |
+</script> |
+</body> |