2 <script src=
"../../../resources/js-test.js"></script>
4 .test { width:
50px; height:
50px; }
5 #t1:hover { background-color: green }
6 #t2:hover .class { background-color: green }
7 #t3:hover span { background-color: green }
9 <div id=
"t1" class=
"test">
15 <div id=
"t2" class=
"test">
18 <div class=
"class"></div>
21 <div id=
"t3" class=
"test">
24 <div><span></span></div>
25 <div><span></span></div>
28 description("Check that invalidation sets work for :hover changes.");
30 function hoverElement(element
) {
31 eventSender
.mouseMoveTo(0, 0);
32 document
.body
.offsetLeft
; // force recalc.
33 var x
= element
.offsetLeft
+ 1;
34 var y
= element
.offsetTop
+ 1;
35 eventSender
.mouseMoveTo(x
, y
);
38 shouldBeDefined("window.internals");
39 shouldBeDefined("window.eventSender");
41 var transparent
= "rgba(0, 0, 0, 0)";
42 var green
= "rgb(0, 128, 0)";
44 var t1
= document
.getElementById("t1");
45 var t2
= document
.getElementById("t2");
46 var t3
= document
.getElementById("t3");
49 var r2
= t2
.querySelector(".class");
50 var r3
= t3
.querySelectorAll("span");
52 shouldBe("getComputedStyle(r1, null).backgroundColor", "transparent");
53 shouldBe("getComputedStyle(r2, null).backgroundColor", "transparent");
54 shouldBe("r3.length", "2");
55 shouldBe("getComputedStyle(r3[0], null).backgroundColor", "transparent");
56 shouldBe("getComputedStyle(r3[1], null).backgroundColor", "transparent");
59 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
60 shouldBe("getComputedStyle(r1, null).backgroundColor", "green");
63 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
64 shouldBe("getComputedStyle(r2, null).backgroundColor", "green");
67 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3");
68 shouldBe("getComputedStyle(r3[0], null).backgroundColor", "green");
69 shouldBe("getComputedStyle(r3[1], null).backgroundColor", "green");