4 <title>Switch between display block and none on :focus
</title>
9 background-color: blue;
23 <script src=
"../../resources/js-test.js"></script>
26 <script type=
"text/javascript">
27 if (window
.testRunner
)
28 testRunner
.waitUntilDone();
30 function beginTest() {
31 if (window
.eventSender
) {
32 var button
= document
.getElementById("button");
40 if (window
.eventSender
) {
41 var button
= document
.getElementById("button");
42 var displayMode
= window
.getComputedStyle(button
).getPropertyValue("display");
44 if (displayMode
== "none")
45 testPassed("Setting display to none on focus processed OK.");
47 testFailed("Setting display to none on focus FAILED." + " (expected 'none', got '" + displayMode
+ "')");
49 var elementsToHide
= document
.getElementsByClassName('box');
50 for (var element
, i
= 0; element
= elementsToHide
[i
]; i
++)
51 element
.style
.visibility
= "hidden";
53 if (window
.testRunner
)
54 testRunner
.notifyDone();
60 <body onload=
"beginTest()">
61 <button type=
"button" id=
"button">When you hit TAB, this button should disappear.
</button>
62 <div class=
"box">This is here to show the layout being recomputed
</div>