b017eab07bcdd3ca163633ec87c8f3e5ab6f9ae2
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / stuck-with-hover-state.html
1 <html>
2 <head>
3 <title>This test that we trigger click when hover would not display non-clickable content.</title>
4 <script src="../../../../../resources/basic-gestures.js"></script>
5 <style>
6 #tapthis {
7     width: 400px;
8     height: 400px;
9     border: 1px solid green;
10 }
11 </style>
12 <script>
13 async function test() {
14     if (!window.testRunner || !testRunner.runUIScript)
15         return;
16     if (window.internals)
17         internals.settings.setContentChangeObserverEnabled(true);
18
19     testRunner.dumpAsText();
20     testRunner.waitUntilDone();
21
22     let rect = tapthis.getBoundingClientRect();
23     let x = rect.left + rect.width / 2;
24     let y = rect.top + rect.height / 2;
25
26         await tapAtPoint(x, y);
27
28     setTimeout("testRunner.notifyDone()", 50);
29 }
30 </script>
31 </head>
32 <body onload="test()">
33 <div id=tapthis>PASS if clicked.</div>
34 <pre id=result></pre>
35 <script>
36 tapthis.addEventListener("mouseover", function( event ) {
37         clearTimeout(setTimeout(function() { tapthis.innerHTML = "should not see this"; }, 50));
38 }, false);
39
40 tapthis.addEventListener("click", function( event ) {   
41         result.innerHTML = "clicked";
42 }, false);
43 </script>
44 </body>
45 </html>