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