LayoutTests:
[WebKit-https.git] / LayoutTests / fast / events / no-blur-on-page-leave.html
1 <script>
2 function test()
3 {
4     if (!window.layoutTestController)
5         return;
6
7     layoutTestController.dumpAsText();
8     layoutTestController.waitUntiDone();
9
10     var element = document.getElementById("elem");
11     element.focus();
12     element.onchange();
13 }
14 function failed()
15 {
16     document.getElementById("console").innerHTML = "blur event fired, FAILED!";
17     window.location = 'resources/no-blur-result.html/#FAILED';
18     layoutTestController.notifyDone();
19 }
20
21 </script>
22 <body onload="test();">
23 onblur should not fire if an element has focus when navigating away from the page<br>
24 <a href="rdar://problem/5326303">rdar://problem/5326303</a><br>
25 <select id="elem" onchange="window.location='resources/no-blur-result.html';" onblur="failed()">
26 <option>CHANGE ME</option>
27 <option>PICK ME</option>
28 </select>
29 <pre id=console>
30 </pre>
31 </body>