Split iOS tests for hit testing in iframes
[WebKit-https.git] / LayoutTests / fast / scrolling / ios / hit-testing-iframe-005.html
1 <!DOCTYPE html>
2 <html>
3   <head>
4     <title>Hit testing of iframe</title>
5     <meta name="viewport" content="width=device-width, initial-scale=1">
6     <script src="../../../resources/basic-gestures.js"></script>
7     <script type="text/javascript">
8       if (window.testRunner)
9           testRunner.waitUntilDone();
10       if (window.internals)
11           internals.settings.setAsyncFrameScrollingEnabled(true);
12
13       async function runTest() {
14           if (!window.testRunner || !testRunner.runUIScript)
15               return;
16
17           // This verifies that a click event is consumed by an element inside the frame, after a programmatic scroll.
18           var frame = document.getElementById("clickElementInsideFrameAfterProgrammaticScroll");
19           frame.contentWindow.window.scrollTo(100, 100);
20           var p = frame.getBoundingClientRect();
21           await tapAtPoint(p.left + 7 + 10, p.top + 7 + 10);
22           testRunner.notifyDone();
23       }
24     </script>
25     <style>
26         iframe {
27             position: absolute;
28             height: 90px;
29             width: 90px;
30             overflow: none;
31             margin: 0;
32             border: 0;
33             padding: 5px;
34         }
35     </style>
36   </head>
37   <body>
38     <p>This test passes if you see a green rectangle.</p>
39     <div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
40       <iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
41           <body style='margin: 0; width: 200px; height: 200px; background: green;'>
42              <div style='position: absolute; width: 75px; height: 75px; background: red;'></div>
43               <div style='position: absolute; left: 110px; top: 110px; width: 50px; height: 50px; background: red;'
44                    onclick='this.style.background=&quot;green&quot;'></div>
45           </body>" onload="runTest()">
46       </iframe>
47     </div>
48 </body>
49 </html>