[iOS] Unreviewed gardening.
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / visibility-change-happens-at-the-second-timer.html
1 <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2 <html>
3 <head>
4 <title>This tests the case when the second timer triggers visible content change</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     visibility: hidden;
15     width: 100px;
16     height: 100px;
17     background-color: green;
18 }
19 </style>
20 <script>
21 async function test() {
22     if (!window.testRunner || !testRunner.runUIScript)
23         return;
24         if (window.internals)
25                 internals.settings.setContentChangeObserverEnabled(true);
26
27     testRunner.waitUntilDone();
28     testRunner.dumpAsText();
29
30     let rect = tapthis.getBoundingClientRect();
31     let x = rect.left + rect.width / 2;
32     let y = rect.top + rect.height / 2;
33
34     await tapAtPoint(x, y);
35 }
36 </script>
37 </head>
38 <body onload="test()">
39 <div id=tapthis>PASS if 'clicked' text is not shown below.</div>
40 <div id=becomesVisible></div>
41 <pre id=result></pre>
42 <script>
43 tapthis.addEventListener("mouseover", function( event ) {
44     // 1. Install 2 timers on hover
45     setTimeout(function() {
46         // 2. Trigger some non-visibility style change with forcing offsetHeight.
47         becomesVisible.style.marginLeft = "5px";
48         document.body.offsetHeight;
49     }, 0);
50     // 3. Install a longer timer with visibility change.
51     setTimeout(function() {
52         becomesVisible.style.visibility = "visible";
53         document.body.offsetHeight;
54         setTimeout("testRunner.notifyDone()", 0);
55     }, 20);
56 }, false);
57
58 becomesVisible.addEventListener("click", function( event ) {   
59     result.innerHTML = "clicked hidden";
60 }, false);
61
62 tapthis.addEventListener("click", function( event ) {   
63     result.innerHTML = "clicked";
64 }, false);
65 </script>
66 </body>
67 </html>