Split iOS tests for hit testing in iframes
[WebKit-https.git] / LayoutTests / fast / scrolling / ios / hit-testing-iframe-001.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 whether the iframe handles clicks inside its content box.
18           var p = document.getElementById("clickInContentBox").getBoundingClientRect();
19           await tapAtPoint(p.left + 7, p.top + 7);
20           testRunner.notifyDone();
21       }
22     </script>
23     <style>
24         iframe {
25             position: absolute;
26             height: 90px;
27             width: 90px;
28             overflow: none;
29             margin: 0;
30             border: 0;
31             padding: 5px;
32         }
33     </style>
34   </head>
35   <body>
36     <p>This test passes if you see a green rectangle.</p>
37     <div style="position: absolute; top: 3em; width: 100px; height: 100px; background: green;">
38       <iframe id="clickInContentBox" style="left: 0px; top: 0px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
39           <body style='margin: 0; width: 200px; height: 200px'>
40               <div style='position: absolute; width: 100px; height: 100px; background: red;'
41                    onclick='this.style.background=&quot;green&quot;'></div>
42           </body>" onload="runTest()">
43       </iframe>
44     </div>
45 </body>
46 </html>