3 <body onload=
"startTest()">
4 This tests for the remove order of discard elements.
<br/>
5 <div id=
"removeOrder"></div>
6 <svg id=
"svg" width=
"400" height=
"400" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink">
7 <rect id=
"rect" width=
"100" height=
"100" fill=
"green" />
8 <animate id=
"animate" xlink:
href=
"#rect" attributeName=
"x" from=
"0" to=
"300" begin=
"0s" dur=
"10s" />
9 <discard xlink:
href=
"#animate" begin=
"0s" />
10 <discard xlink:
href=
"#rect" begin=
"0s" />
13 var removedNodes
= new Array();
14 var callback = function(mutations
) {
15 mutations
.forEach( function(mutation
) {
16 var nodeList
= mutation
.removedNodes
;
17 for (var i
= 0; i
< nodeList
.length
; ++i
) {
18 removedNodes
.push(nodeList
[i
].nodeName
);
22 var observer
= new MutationObserver(callback
);
23 var target
= document
.getElementById("svg");
24 options
= { 'childList': true, 'subtree': true }
25 observer
.observe(target
, options
);
27 function startTest() {
28 if (window
.testRunner
)
29 testRunner
.waitUntilDone();
30 setTimeout(function() {
31 document
.getElementById('removeOrder').textContent
= 'Discard node removal order: ' + removedNodes
.toString();
32 if (window
.testRunner
) {
33 testRunner
.dumpAsText();
34 testRunner
.notifyDone();