3 <script src=
"../../../../resources/js-test.js"></script>
5 <style type=
"text/css">
16 background-color: lightblue
;
20 background-color: lightgreen
;
24 background-color: yellow
;
28 #hoverme:hover #dontclickme
{
33 <body style=
"margin:0">
35 <div id='hoverme'
>Hover over me
36 <div id='dontclickme'
>Don't click me
</div>
38 <div id='clickme'
>Click me
</div>
40 <p id=
"description"></p>
41 <p>See https://bugs.webkit.org/show_bug.cgi?id=
103283 for details.
</p>
43 <div id=
"console"></div>
46 description("Tests that hover effects from a gesture tap down can be cleared by a gesture tap or mousemove outside of the hovered element.");
48 var clickMe
= document
.getElementById('clickme');
49 var dontClickMe
= document
.getElementById('dontclickme');
53 if (!window
.eventSender
) {
54 debug('This test requires DRT.');
58 if (!eventSender
.gestureShowPress
|| !eventSender
.gestureTap
|| !eventSender
.mouseMoveTo
) {
59 debug('GestureShowPress, GestureTap, or MouseMoveTo is not supported by this platform');
63 debug("The Don't Click Me div should not be visible.");
64 shouldBe("dontClickMe.offsetTop", "0");
66 debug("The Don't Click Me div should be visible after a GestureShowPress on the Hover Over Me div.");
67 shouldBe(document
.elementFromPoint(50, 50).id
, "hoverme");
68 eventSender
.gestureShowPress(50, 50);
69 shouldBe("dontClickMe.offsetTop", "100");
71 debug("The Don't Click Me div should not be visible after a GestureTap on the Click Me div.");
72 shouldBe(document
.elementFromPoint(250, 250).id
, "clickme");
73 eventSender
.gestureTap(250, 250);
74 waitUntilActiveCleared();
77 function waitUntilActiveCleared()
79 if (dontClickMe
.offsetTop
!= 0) {
80 return setTimeout(waitUntilActiveCleared
, 10);
83 shouldBe("dontClickMe.offsetTop", "0");
85 debug("The Don't Click Me div should be visible after a GestureShowPress on the Hover Over Me div.");
86 shouldBe(document
.elementFromPoint(50, 50).id
, "hoverme");
87 eventSender
.gestureShowPress(50, 50);
88 shouldBe("dontClickMe.offsetTop", "100");
90 debug("The Don't Click Me div should not be visible after a mouse move to below the Click Me div.");
91 eventSender
.mouseMoveTo(350, 350);
92 shouldBe("dontClickMe.offsetTop", "0");
97 if (window
.testRunner
) {
98 window
.jsTestIsAsync
= true;
99 testRunner
.waitUntilDone();