Modernize for loops in JSC
[WebKit-https.git] / LayoutTests / css3 / scroll-snap / scroll-snap-positions-overflow-resize.html
1 <html>
2
3 <head>
4     <style>
5         #container {
6             width: 420px;
7             height: 400px;
8             overflow-y: scroll;
9             scroll-snap-type: y mandatory;
10         }
11
12         .cell {
13             width: 400px;
14             height: 400px;
15             scroll-snap-align: start;
16         }
17     </style>
18     <script src="../../resources/js-test-pre.js"></script>
19     <script>
20     function setup()
21     {
22         var container = document.getElementById("container");
23
24         function dumpSnapOffsetsAndFinishTest()
25         {
26             debug("Scroll-snap offsets: " + window.internals.scrollSnapOffsets(container));
27             finishJSTest();
28         }
29
30         function dumpSnapOffsetsAndResizeElement()
31         {
32             debug("Scroll-snap offsets: " + window.internals.scrollSnapOffsets(container));
33             container.style.width = "425px";
34             setTimeout(dumpSnapOffsetsAndFinishTest, 0);
35         }
36
37         container.scrollTop = 800;
38         if (window.testRunner) {
39             window.jsTestIsAsync = true;
40             testRunner.dumpAsText();
41             testRunner.waitUntilDone();
42             setTimeout(dumpSnapOffsetsAndResizeElement, 0);
43         }
44     }
45     </script>
46 </head>
47
48 <body onload="setup()">
49     <div id="container">
50         <div class="cell"><div id="console"></div></div>
51         <div class="cell"></div>
52         <div class="cell"></div>
53         <div class="cell"></div>
54         <div class="cell"></div>
55         <div class="cell"></div>
56     </div>
57     <script src="../../resources/js-test-post.js"></script>
58 </body>
59
60 </html>