Chromium Code Reviews| Index: LayoutTests/svg/dom/remove-use-target-element-indirectly.html |
| diff --git a/LayoutTests/svg/dom/remove-use-target-element-indirectly.html b/LayoutTests/svg/dom/remove-use-target-element-indirectly.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e5e1059ddc5dcbb80421a39e29f7364ba1855eec |
| --- /dev/null |
| +++ b/LayoutTests/svg/dom/remove-use-target-element-indirectly.html |
| @@ -0,0 +1,47 @@ |
| +<script src="../../resources/js-test.js"></script> |
|
esprehn
2014/05/23 04:38:17
Missing <!DOCTYPE html>
kouhei (in TOK)
2014/05/23 07:17:15
Done.
|
| +<script> |
| +jsTestIsAsync = true; |
| +description("Removing animated use target indirectly from the document should not cause crash."); |
| + |
| +function loadedSVGToBeMoved() |
| +{ |
| + debug("loaded SVG to be moved"); |
| + |
| + moveFromOtherToLocal(); |
| +} |
| + |
| +var count = 0; |
| +function moveFromOtherToLocal() |
| +{ |
| + if (++count > 3) |
| + finishJSTest(); |
| + |
| + var source = document.getElementById("otherWindow").contentDocument; |
| + var defs = source.getElementById("defs"); |
| + |
| + var target = document.getElementById("localWindow"); |
| + target.appendChild(defs); |
| + |
| + debug("other -> local"); |
| + |
| + setTimeout(moveFromLocalToOther, 0); |
|
esprehn
2014/05/23 04:38:17
What are you waiting for? I think you want request
kouhei (in TOK)
2014/05/23 07:17:15
Done.
|
| +} |
| + |
| +function moveFromLocalToOther() |
| +{ |
| + var source = document.getElementById("localWindow"); |
| + var defs = source.getElementById("defs"); |
| + |
| + var target = document.getElementById("otherWindow").contentDocument.documentElement; |
| + target.appendChild(defs); |
| + |
| + debug("local -> other"); |
| + |
| + setTimeout(moveFromOtherToLocal, 0); |
|
esprehn
2014/05/23 04:38:17
setTimeout is suspect, you probably want something
kouhei (in TOK)
2014/05/23 07:17:15
Done.
|
| +} |
| +</script> |
| +<iframe id="otherWindow" src="resources/svg-with-animate-use.svg" onload="loadedSVGToBeMoved()"></iframe> |
| +<svg id="localWindow"> |
| + <use xlink:href="#template" /> |
| +</svg> |
| +<p>Test pass if no crash.</p> |