| |
| <script> |
| function log(message) { |
| var console = document.getElementById("console"); |
| var li = document.createElement("li"); |
| var text = document.createTextNode(message); |
| console.appendChild(li); |
| li.appendChild(text); |
| } |
| |
| function runTest() { |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| |
| var field1 = document.getElementById("field1"); |
| var field2 = document.getElementById("field2"); |
| |
| field1.parentNode.removeChild(field1); |
| field2.focus(); |
| log("Success: finished the test without crashing."); |
| } |
| </script> |
| |
| <body onLoad="document.getElementById('field1').focus();"> |
| <p>This is a test for <a href="https://bugs.webkit.org/show_bug.cgi?id=7363">https://bugs.webkit.org/show_bug.cgi?id=7363</a>. Taking focus away from a text field that no longer had focus was crashing Safari.</p> |
| <input id="field1" type="text" value="field1" onFocus="runTest()"> |
| <input id="field2" type="text" value="field2"> |
| <ul id="console"></ul> |