Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestA...
[WebKit-https.git] / LayoutTests / fast / animation / request-animation-frame-throttle-inside-overflow-scroll.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test-pre.js"></script>
5 <script>
6 description("Tests that requestAnimationFrame is throttled in subframes are inside scrolled overflow scroll");
7 window.jsTestIsAsync = true;
8
9 function scrollOverflow()
10 {
11
12     debug("Scrolling overflow.");
13     var container = document.getElementById('container');
14     container.scrollLeft = window.innerWidth + 10;
15
16     debug("requestAnimationFrame should still not be throttled");
17     shouldBeFalse("testFrame.contentWindow.internals.isRequestAnimationFrameThrottled()");
18     
19     finishJSTest();
20 }
21
22 function runTest()
23 {
24     testFrame = document.getElementById("testFrame");
25     debug("Frame is initially inside the viewport so requestAnimationFrame should not be throttled");
26     shouldBeFalse("testFrame.contentWindow.internals.isRequestAnimationFrameThrottled()");
27     scrollOverflow();
28 }
29 </script>
30 <style>
31 #container {
32     position: absolute;
33     left: 0;
34     width: 300px;
35     height: 200px;
36     overflow-x: auto;
37     background: silver;
38 }
39
40 #testFrame {
41     width: 2000px;
42     height: 100px;
43     border: 2px solid black;
44     will-change: transform;
45 }
46
47 </style>
48 <div id="container">
49     <iframe id="testFrame" src="resources/requestAnimationFrame-frame.html" onload="runTest()"></iframe>
50 </div>
51 <script src="../../resources/js-test-post.js"></script>
52 </body>
53 </html>