blob: 49bbe9c05bf347676db4cf9dae4b5d7638884c3a [file] [log] [blame]
<html>
<head>
<title>basic "autofocus" test</title>
<style>
input { background:red }
input:focus { background:lime }
</style>
<script>
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
requestAnimationFrame(() => {
if (document.activeElement == document.getElementsByTagName("input")[0])
log("SUCCESS");
else
log("FAILURE");
if (window.testRunner)
testRunner.notifyDone();
});
}
</script>
</head>
<body onload="test()">
<p>This form control should have a green background and active state: <input autofocus>
<hr>
<ol id="console"></ol>
</body>
</html>