summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/parser/scriptexec-during-parserInsertBefore.html
blob: 4e5a4db131380945ff4fadf31928e639ef7231fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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>