13 background-color: green;
22 var console
= document
.getElementById('console');
23 var newNode
= document
.createElement('li');
24 newNode
.innerText
= msg
;
25 console
.appendChild(newNode
);
27 var testedHoverState
= false;
28 function testHoverState() {
31 testedHoverState
= true;
32 var innerElem
= document
.getElementById('innerElem');
33 var calculatedStyle
= window
.getComputedStyle(innerElem
);
35 if (calculatedStyle
.getPropertyValue('left') == "auto")
36 log("PASSED: Calculated style of inner element is correct");
38 log("FAILED: Calculated style of inner element is wrong, should be 'left: auto'");
42 if (!window
.layoutTestController
)
44 layoutTestController
.dumpAsText();
45 var targetElem
= document
.getElementById('targetElem');
46 eventSender
.mouseMoveTo(targetElem
.offsetLeft
+ targetElem
.offsetWidth
/ 2,
47 targetElem
.offsetTop
+ targetElem
.offsetHeight
/ 2);
51 <body onload=
"runTest()">
52 This tests that a style that affects child elements when hovering
53 over a parent element correctly recalculates the child style. To
54 test manually move the mouse over the red square, it should become
56 <div id=
"targetElem" onmousemove=
"testHoverState()"><div id=
"innerElem"></div></div>
57 <ul id=
"console"></ul>