[iOS] Unreviewed gardening.
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / new-content-covers-tap-target.html
1 <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2 <html>
3 <head>
4 <title>This tests the case when the new hover content comes on top of the tap target, we update the "node under the mouse" state.</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     position: absolute;
16     left: 40px;
17     top: 40px;
18     width: 320px;
19     height: 320px;
20     background-color: blue;
21 }
22 </style>
23 <script>
24 async function test() {
25     if (!window.testRunner || !testRunner.runUIScript)
26         return;
27     if (window.internals)
28         internals.settings.setContentChangeObserverEnabled(true);
29
30     testRunner.waitUntilDone();
31     testRunner.dumpAsText();
32
33     let rect = tapthis.getBoundingClientRect();
34     let x = rect.left + rect.width / 2;
35     let y = rect.top + rect.height / 2;
36
37     await tapAtPoint(x, y);
38 }
39 </script>
40 </head>
41 <body onload="test()">
42 <div id=tapthis>PASS if 'mouseout' text is not shown below.</div>
43 <div id=becomesVisible></div>
44 <pre id=result></pre>
45 <script>
46 // 1. Tap -> hover 
47 // 2. hover content comes on top of the tap target
48 // 3. Check if tap target gets mouseout
49 tapthis.addEventListener("mousemove", function( event ) {
50     becomesVisible.style.visibility = "visible";
51 }, false);
52
53 tapthis.addEventListener("mouseout", function( event ) {   
54     result.innerHTML = "mouseout";
55     if (window.testRunner)
56         testRunner.notifyDone();
57 }, false);
58 </script>
59 </body>
60 </html>