[iOS] Unreviewed gardening.
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / move-content-from-offscreen.html
1 <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2 <html>
3 <head>
4 <title>This tests the case when the absolute positioned, non-fixed width content is offscreen.</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
13 #becomesVisible {
14         position: absolute;
15         left: -999px;
16         top: 50px;
17     width: 10%;
18     height: 10%;
19     background-color: green;
20 }
21 </style>
22 <script>
23 async function test() {
24     if (!window.testRunner || !testRunner.runUIScript)
25         return;
26     if (window.internals)
27         internals.settings.setContentChangeObserverEnabled(true);
28
29     testRunner.waitUntilDone();
30     testRunner.dumpAsText();
31
32     let rect = tapthis.getBoundingClientRect();
33     let x = rect.left + rect.width / 2;
34     let y = rect.top + rect.height / 2;
35
36     await tapAtPoint(x, y);
37 }
38 </script>
39 </head>
40 <body onload="test()">
41 <div id=tapthis>PASS if 'clicked' text is not shown below.</div>
42 <div id=becomesVisible></div>
43 <pre id=result></pre>
44 <script>
45 tapthis.addEventListener("mousemove", function( event ) {
46     setTimeout(function() {
47         becomesVisible.style.left = "0px";
48         document.body.offsetHeight;
49         if (window.testRunner)
50             testRunner.notifyDone();
51     }, 300);
52 }, false);
53
54 becomesVisible.addEventListener("click", function( event ) {   
55     result.innerHTML = "clicked hidden";
56 }, false);
57
58 tapthis.addEventListener("click", function( event ) {   
59     result.innerHTML = "clicked";
60 }, false);
61 </script>
62 </body>
63 </html>