4 <title>Switch between display block and inline on :hover
</title>
11 background-color: black;
14 border:
5px solid green;
15 border-left:
100px solid green;
20 border-color: darkred;
24 background-color: blue;
30 <script src=
"../../resources/js-test.js"></script>
34 <div id=
"dummy" class=
"box"></div>
35 <div id=
"hoverTest" class=
"box">When hovered, this box's display will switch from
<b>block
</b> to
<b>inline
</b></div>
36 <div id=
"after_hoverTest" class=
"box">This is here to show the layout being recomputed
</div>
38 <script type=
"text/javascript">
39 if (window
.testRunner
)
40 testRunner
.waitUntilDone();
42 function beginTest() {
43 if (window
.eventSender
) {
44 var hoverTest
= document
.getElementById("hoverTest");
46 // move mouse on the hover test object
47 eventSender
.mouseMoveTo(hoverTest
.offsetLeft
+ 50, hoverTest
.offsetTop
+ 10);
48 eventSender
.mouseDown(0);
55 if (window
.eventSender
) {
56 var hoverTest
= document
.getElementById("hoverTest");
57 var displayMode
= window
.getComputedStyle(hoverTest
).getPropertyValue("display");
59 if (displayMode
== "inline")
60 testPassed("Setting display to inline on hover processed OK.");
62 testFailed("Setting display to inline on hover FAILED." + " (expected 'inline', got '" + displayMode
+ "')");
64 var elementsToHide
= document
.getElementsByClassName('box');
65 for (var element
, i
= 0; element
= elementsToHide
[i
]; i
++)
66 element
.style
.visibility
= "hidden";
68 eventSender
.mouseUp(0);
70 if (window
.testRunner
)
71 testRunner
.notifyDone();