2 <div id="result"></div>
3 <div style="position: relative; height: 200px; overflow: auto;">
4 <div id="target" style="height: 75%; background-color: red;"></div>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 window.onload = function () {
13 // Force a layout with offsetHeight, and then start toggling overflow.
19 var recursionDepth = 0;
21 var target = document.getElementById("target");
22 var result = document.getElementById("result");
26 result.innerHTML = "PASS";
27 if (window.testRunner)
28 testRunner.notifyDone();
33 result.innerHTML = "FAIL";
34 if (window.testRunner)
35 testRunner.notifyDone();
38 function toggleOverflow()
43 // The code change associated with this test will cause this function to start
44 // firing asynchronously.
45 if (recursionDepth > 2) {
50 // If we have made it this far without a recursionDepth of 2 or greater, then we
51 // can say that the test passed.
57 if (target.style.height === "75%")
58 target.style.height = "200%";
60 target.style.height = "75%";
65 target.parentNode.addEventListener("overflowchanged", toggleOverflow);