mjs | d85e328 | 2007-07-20 22:35:50 +0000 | [diff] [blame] | 1 | <script> |
| 2 | function test() |
| 3 | { |
rniwa@webkit.org | ada3c20 | 2012-06-20 03:28:42 +0000 | [diff] [blame] | 4 | if (!window.testRunner) |
mjs | d85e328 | 2007-07-20 22:35:50 +0000 | [diff] [blame] | 5 | return; |
| 6 | |
rniwa@webkit.org | ada3c20 | 2012-06-20 03:28:42 +0000 | [diff] [blame] | 7 | testRunner.dumpAsText(); |
| 8 | testRunner.waitUntilDone(); |
mjs | d85e328 | 2007-07-20 22:35:50 +0000 | [diff] [blame] | 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'; |
rniwa@webkit.org | ada3c20 | 2012-06-20 03:28:42 +0000 | [diff] [blame] | 18 | testRunner.notifyDone(); |
mjs | d85e328 | 2007-07-20 22:35:50 +0000 | [diff] [blame] | 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> |