Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Node / mutation-blur.html
blob95f9a231b230301f1c979acc1835589528421fa5
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 var container1;
10 var container2;
11 var elem;
13 function handler2()
15 container2.appendChild(elem);
18 function onload()
20 container1 = document.getElementById("newcontainer1");
21 container2 = document.getElementById("newcontainer2");
23 if (!window.eventSender)
24 return;
26 var rect = document.getElementById("trigger").getBoundingClientRect();
27 eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
28 eventSender.mouseDown();
29 eventSender.mouseUp();
32 function onpress()
34 elem = document.getElementById("subcontainer1");
35 document.getElementById("sub1").focus();
37 try {
38 container1.appendChild(elem);
39 container1.removeChild(elem);
40 elem = null;
42 catch (e) { }
44 // Force GC.
45 if (this.GCController)
46 GCController.collect();
47 else {
48 for (var i = 0; i < 10000; ++i) {
49 ({ });
53 document.body.removeChild(container2);
55 if (window.testRunner)
56 testRunner.notifyDone();
60 </script>
61 </head>
62 <body onload="onload()">
63 <p>Tests for proper handling of DOM changes during a blur event. If the test doesn't crash, it passed.
64 <div id="subcontainer1">
65 <textarea id="sub1" onblur="handler2()"></textarea>
66 </div>
68 <input id="trigger" type="button" name="Press" value="press" onclick="onpress()">
69 <div id="newcontainer1"></div>
70 <div id="newcontainer2"></div>
72 </body>
73 </html>