Bug 569955 - Add a test to make sure that autofocus on input elements does not work if they don't have a frame; r=ehsan

This commit is contained in:
Mounir Lamouri 2010-06-04 13:25:54 -04:00
parent 8b8e8e2584
commit 08963e09d2
2 changed files with 36 additions and 0 deletions

View File

@ -183,6 +183,7 @@ _TEST_FILES = test_bug589.html \
test_bug567938-2.html \
test_bug567938-3.html \
test_bug567938-4.html \
test_bug569955.html \
$(NULL)
libs:: $(_TEST_FILES)

View File

@ -0,0 +1,35 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=569955
-->
<head>
<title>Test for Bug 569955</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="SimpleTest.executeSoon(runTests);">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=569955">Mozilla Bug 569955</a>
<p id="display"></p>
<div id="content" style="display: none">
<input id='i' autofocus>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 569955 **/
SimpleTest.waitForExplicitFinish();
function runTests()
{
isnot(document.activeElement, document.getElementById('i'),
"not rendered elements can't be autofocused");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>