blob: 11bd39504c9dda8489201dd8a75154780d9089ee [file] [log] [blame]
<html>
<head>
<title>"autofocus" and the blur() method</title>
<style>
input { background:lime }
input:focus { background:red }
</style>
<script>
var gotBlur = false;
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function switchBlur() {
gotBlur = true;
}
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
requestAnimationFrame(() => {
if (gotBlur)
log("SUCCESS");
else
log("FAILURE");
if (window.testRunner)
testRunner.notifyDone();
});
}
</script>
</head>
<body onload="test()">
<p>The form control below should have a green background:
<p><input autofocus onfocus="this.blur()" onblur="switchBlur()">
<hr/>
<ol id="console"></ol>
</body>
</html>