[iOS] Unreviewed gardening.
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / content-observation / mouse-out-event-should-fire-on-click.html
1 <!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2 <html>
3 <head>
4 <title>This tests that we fire mouseout on synthetic click</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     width: 100px;
15     height: 100px;
16     background-color: green;
17 }
18 </style>
19 <script>
20 async function test() {
21     if (!window.testRunner || !testRunner.runUIScript)
22         return;
23     if (window.internals)
24         internals.settings.setContentChangeObserverEnabled(true);
25
26     testRunner.waitUntilDone();
27     testRunner.dumpAsText();
28
29     let rect = tapthis.getBoundingClientRect();
30     let x = rect.left + rect.width / 2;
31     let y = rect.top + rect.height / 2;
32
33     await tapAtPoint(x, y);
34 }
35 </script>
36 </head>
37 <body onload="test()">
38 <div id=tapthis>PASS if 'mouseout' text is shown below.</div>
39 <div id=becomesVisible></div>
40 <pre id=result></pre>
41 <script>
42
43 becomesVisible.addEventListener("click", function( event ) {   
44     result.innerHTML = "clicked hidden";
45 }, false);
46
47 tapthis.addEventListener("mouseout", function( event ) {   
48     result.innerHTML = result.innerHTML + " mouseout triggered ";
49     if (window.testRunner)
50         testRunner.notifyDone();
51 }, false);
52
53 tapthis.addEventListener("click", function( event ) {   
54     result.innerHTML = result.innerHTML + " clicked ";
55 }, false);
56 </script>
57 </body>
58 </html>