Modernize for loops in JSC
[WebKit-https.git] / LayoutTests / css3 / scroll-snap / improper-snap-points-crash.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <style>
5             .horizontalGallery {
6                 width: 100px;
7                 height: 100px;
8                 overflow-y: hidden;
9                 overflow-x: auto;
10                 margin: 2px;
11                 -webkit-overflow-scrolling: touch;
12                 -webkit-scroll-snap-points-x: repeat(100%);
13                 -webkit-scroll-snap-type: mandatory;
14                 -webkit-scroll-snap-coordinate: 50% 50%;
15             }
16             .horizontalGalleryDrawer {
17                 width: 600px;
18                 height: 100px;
19             }
20             .colorBox {
21                 height: 100px;
22                 width: 100px;
23                 float: left;
24             }
25             #item0 { background-color: red; }
26             #item1 { background-color: green; }
27             #item2 { background-color: blue; }
28             #item3 { background-color: aqua; }
29             #item4 { background-color: yellow; }
30             #item5 { background-color: fuchsia; }
31         </style>
32         <script src="../../resources/js-test-pre.js"></script>
33         <script>
34         function reportResult(horizontalTargetID)
35         {
36             var horizontalTarget = document.getElementById(horizontalTargetID);
37
38             debug("Scroll-snap offsets for " + horizontalTargetID + ": " + window.internals.scrollSnapOffsets(horizontalTarget));
39         }
40
41         function runTest()
42         {
43             reportResult('horizontalTarget');
44             reportResult('first');
45             reportResult('second');
46             reportResult('third');
47
48             finishJSTest();
49             testRunner.notifyDone();
50         }
51
52         function onLoad()
53         {
54             if (window.testRunner) {
55                 window.jsTestIsAsync = true;
56                 testRunner.dumpAsText();
57                 testRunner.waitUntilDone();
58                 setTimeout(runTest, 0);
59             }
60         }
61         </script>
62     </head>
63     <body onload="onLoad();">
64         <div style="position: relative; width: 300px">
65             <div>The test passes if this page renders without crashing.</div>
66             <div class="horizontalGallery" id="horizontalTarget">
67                 <div class="horizontalGalleryDrawer">
68                     <div id="item0" class="colorBox"></div>
69                     <div id="item1" class="colorBox"></div>
70                     <div id="item2" class="colorBox"></div>
71                     <br id="first" />
72                     <br class="horizontalGallery" id="second" />
73                 </div>
74             </div>
75             <br class="horizontalGallery" id="third" />
76             <div id="console"></div>
77         </div>
78         <script src="../../resources/js-test-post.js"></script>
79     </body>
80 </html>