|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <title>Test for overflow events</title> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 <script type="application/javascript"> |
|
9 |
|
10 SimpleTest.waitForExplicitFinish(); |
|
11 |
|
12 window.addEventListener("load", function(event) { |
|
13 if (event.target == document) { |
|
14 test_bug981637(); |
|
15 } |
|
16 }, false); |
|
17 |
|
18 /** Test for Bug 981637: correct overflow event firing in updateOverflow **/ |
|
19 |
|
20 var overflow_fired = false; |
|
21 function overflow_listener(event) { |
|
22 overflow_fired = true; |
|
23 } |
|
24 |
|
25 function test_bug981637() { |
|
26 var outerDiv = document.getElementById("bug981637"); |
|
27 var innerDiv = outerDiv.firstChild; |
|
28 innerDiv.offsetWidth; // flush layout |
|
29 is(overflow_fired, false, "correct setup"); |
|
30 outerDiv.addEventListener("overflow", overflow_listener, false); |
|
31 innerDiv.style.transform = "scale(1.2)"; |
|
32 innerDiv.offsetWidth; // flush layout |
|
33 // run finish step after the overflow event fires (off the event loop) |
|
34 setTimeout(test_bug981637_step2, 0); |
|
35 } |
|
36 |
|
37 function test_bug981637_step2() { |
|
38 is(overflow_fired, true, "overflow event should have fired after updating transform"); |
|
39 SimpleTest.finish(); |
|
40 } |
|
41 |
|
42 </script> |
|
43 </head> |
|
44 <body> |
|
45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=981637">Mozilla Bug 981637</a> |
|
46 <div id="bug981637" style="overflow: hidden; width: 100px; height: 100px;"><div style="transform: scale(0.8); width: 100px; height: 100px"></div></div> |
|
47 <pre id="test"> |
|
48 </pre> |
|
49 </body> |
|
50 </html> |