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