Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / adopt-node-prevented.html
blobdd217640e30cc3e9d605650e93d30368ca552f5e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="newParent"></div>
8 <a href="#" id="target"></a>
9 <script>
10 description("Test that adoptNode fails safely if prevented by a DOM mutation.");
12 function run() {
13 newParent = document.getElementById("newParent");
14 target = document.getElementById("target");
15 target.addEventListener("blur", function () { newParent.appendChild(target); }, false);
16 target.focus();
17 var anotherDocument = document.implementation.createDocument("", "", null);
19 try { anotherDocument.adoptNode(target); } catch(e) {}
20 shouldBe("target.ownerDocument.location", "document.location");
23 document.addEventListener("DOMContentLoaded", run, false);
24 </script>
25 </body>
26 </html>