blob: 93e453dd92fa9f7dcde2e5d10305ad9a71f84ac6 [file] [log] [blame]
<html>
<head>
<title>dynamically inserted control with "autofocus" set</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>FAIL (The script did not run.)</p>
<script>
document.getElementsByTagName('p')[0].innerHTML = "This form control should have a green background: <input autofocus>";
</script>
<hr>
<ol id="console"></ol>
</body>
</html>