| <script src="../../resources/js-test-pre.js"></script> |
| <div style="position: relative; width: 1600px; height: 2400px; background-color: green;"> |
| <div style="position:absolute; left: 600px; top: 800px;"> |
| <div id="testElement">TEST</div> |
| description("Tests that a repeating timer changing the height of an element outside viewport does not get throttled."); |
| var testElement = document.getElementById('testElement'); |
| // Change the height of the element while it is outside viewport. |
| testElement.style["height"] = "" + iterationCount; |
| // 5 iterations should be sufficient to throttle the timer. |
| if (iterationCount == 5) { |
| // Do not use shouldBeTrue() because it would cause a DOM tree mutation |
| // and unthrottle the timer. |
| shouldBeFalse("internals.isTimerThrottled(timeoutId)"); |
| clearInterval(timeoutId); |
| timeoutId = setInterval(timerCallback, 10); |
| shouldBeFalse("internals.isTimerThrottled(timeoutId)"); |
| <script src="../../resources/js-test-post.js"></script> |