4 <script src=
"../../../resources/js-test.js"></script>
8 testRunner
.dumpAsText();
10 window
.mutations
= [];
11 var observer
= new MutationObserver(function(mutations
, observer
) {
12 window
.mutations
= window
.mutations
.concat(mutations
);
14 observer
.observe(document
.body
, {childList
: true, subtree
:true});
18 Mutation records should be delivered for all parser mutations after the above script.
21 <!-- Test parserRemoveChild and takeAllChildrenFrom doing the adoption agency algorithm. -->
22 <a><figure><iframe></iframe></a>
24 <!-- Test parserInsertBefore doing hoisting of elements from tables. -->
30 shouldBe('mutations.length', '22');
31 for (var i
= 0; i
< mutations
.length
; i
++)
32 shouldBeEqualToString('mutations[' + i
+ '].type', 'childList');
33 shouldBeEqualToString('mutations[1].target.tagName', 'BODY');
34 shouldBe('mutations[1].addedNodes.length', '1');
35 shouldBeEqualToString('mutations[1].addedNodes[0].tagName', 'P');
36 shouldBeEqualToString('mutations[9].target.tagName', 'A');
37 shouldBeEqualToString('mutations[9].removedNodes[0].tagName', 'FIGURE');
38 shouldBe('mutations[9].removedNodes.length', '1');
39 shouldBe('mutations[9].addedNodes.length', '0');
40 shouldBeEqualToString('mutations[18].target.tagName', 'FIGURE');
41 shouldBe('mutations[18].addedNodes.length', '1');
42 shouldBe('mutations[18].removedNodes.length', '0');
43 shouldBeEqualToString('mutations[18].addedNodes[0].tagName', 'DIV');