summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/text/textfield-focus-out.html
blob: 2dbe4e09d1fcbb1a9650d3d8774513b975409a20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

<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>