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