a0bbe0276f07422324f4d7b858f7bc4273923a6f
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / click-instead-of-hover-simple.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         let newContent = document.createElement("div");
38         newContent.innerHTML = "tooltip";
39         document.body.appendChild(newContent);          
40 }, false);
41
42 tapthis.addEventListener("click", function( event ) {   
43         result.innerHTML = "clicked";
44 }, false);
45 </script>
46 </body>
47 </html>