REGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinat...
[WebKit-https.git] / LayoutTests / fast / events / resources / ghostly-mousemoves-in-subframe-the-actual-subframe.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4     <div id="clickable_div_in_subframe">beautiful brown eyes</div>
5 </body>
6 <head>
7     <script>
8         function debug(s) {
9             top.document.querySelector("#console").innerText += s + "\n";
10         }
11
12         function logEvent(e) {
13             debug(e.target.id + " got " + event.type + " at " + event.x + "," + event.y);
14         }
15
16         window.onload = function() {
17             var clickable_div_in_subframe = document.querySelector("#clickable_div_in_subframe");
18
19             clickable_div_in_subframe.onmousemove = function(event) {
20                 logEvent(event);
21             };
22
23             clickable_div_in_subframe.onmouseover= function(event) {
24                 logEvent(event);
25             };
26
27             clickable_div_in_subframe.onclick = function(event) {
28                 logEvent(event);
29
30                 var overlapping_div_in_main_frame = top.document.querySelector("#overlapping_div_in_main_frame");
31
32                 // Give overlapping_div_in_main_frame a renderer. It should now be right under the cursor.
33                 overlapping_div_in_main_frame.style.display = "block";
34
35                 // Force clickable_div_in_subframe to lose its renderer.
36                 this.style.display = "none";
37                 this.clientHeight;
38
39                 // Force clickable_div_in_subframe to gain a new renderer.
40                 this.style.display = "block";
41                 this.clientHeight;
42             };
43         };
44     </script>
45 </head>
46 </html>