9301e21b8d13e139129cc6a5804571802fbac888
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / non-visible-content-gains-new-renderer.html
1 <html>
2 <head>
3 <title>This tests the case when non-visible content gets rebuilt and should not be considered as new content</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 #notVisible {
13     visibility: hidden;
14     display: block;
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 shown below.</div>
40 <div id=visibleParent><div id=notVisible>content</div></div>
41 <pre id=result></pre>
42 <script>
43 tapthis.addEventListener("mouseover", function( event ) {
44     visibleParent.style.display = "inline-block";
45     document.body.offsetHeight;
46 }, false);
47
48 notVisible.addEventListener("click", function( event ) {   
49     result.innerHTML = "clicked hidden";
50 }, false);
51
52 tapthis.addEventListener("click", function( event ) {   
53     result.innerHTML = "clicked";
54     if (window.testRunner)
55         testRunner.notifyDone();
56 }, false);
57 </script>
58 </body>
59 </html>