blob: 4a3dfc467d98bcb02230136a927a56288d4f9e0a [file] [log] [blame]
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>testing "autofocus" in XHTML combined with dynamic changes</title>
<style>
input { background:red }
input:focus { background:lime }
</style>
<script language="JavaScript" type="text/javascript">
function log(message) {
document.getElementById("console").innerHTML += "<li>"+message+"</li>";
}
function test() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var input = document.getElementsByTagName('input')[0];
var p = document.getElementsByTagName('p')[0];
var input = p.removeChild(input);
input.setAttribute('autofocus','false');
p.appendChild(input);
setTimeout(check, 0);
}
function check() {
if (document.activeElement == document.getElementsByTagName("input")[0])
log("SUCCESS");
else
log("FAILURE");
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body onload="test()">
<p>The form control should have a green background: <input/></p>
<hr/>
<ol id="console"></ol>
</body>
</html>