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