Modernize for loops in JSC
[WebKit-https.git] / LayoutTests / tiled-drawing / scrolling / scroll-snap / scroll-snap-destination-lock-up.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <style>
5             .horizontalGallery {
6                 width: 400px;
7                 height: 50px;
8                 overflow-y: hidden;
9                 overflow-x: auto;
10             }
11             .horizontalGalleryDrawer {
12                 width: 3000px;
13                 height: 50px;
14             }
15             .colorBox {
16                 height: 50px;
17                 width: 400px;
18                 float: left;
19             }
20
21             .lockUpSnapCoordinate {
22                 -webkit-scroll-snap-type: mandatory;
23                 -webkit-scroll-snap-points-x: repeat(100%);
24                 -webkit-scroll-snap-points-y: repeat(100%);
25                 -webkit-scroll-snap-destination: 100% 100%;
26                 -webkit-scroll-snap-coordinate: initial;
27             }
28
29             #item0 { background-color: red; }
30             #item1 { background-color: green; }
31             #item2 { background-color: blue; }
32             #item3 { background-color: aqua; }
33             #item4 { background-color: yellow; }
34             #item5 { background-color: fuchsia; }
35         </style>
36         <script src="../../../resources/js-test-pre.js"></script>
37     </head>
38     <body>
39         <div style="width: 400px">
40             <div id="lockUpSnapCoordinate" class="horizontalGallery lockUpSnapCoordinate">
41                 <div class="horizontalGalleryDrawer">
42                     <div id="item0" class="colorBox"></div>
43                     <div id="item1" class="colorBox"></div>
44                     <div id="item2" class="colorBox"></div>
45                     <div id="item3" class="colorBox"></div>
46                     <div id="item4" class="colorBox"></div>
47                     <div id="item5" class="colorBox"></div>
48                 </div>
49             </div>
50         </div>
51         This test passes if it doesn't time out.
52         <div id="console"></div>
53         <script>
54         description("Tests infinite loop calculating scroll snap point offsets.");
55
56         var lockUpSnapCoordinate = document.getElementById('lockUpSnapCoordinate');
57         shouldBeEmptyString("lockUpSnapCoordinate.style['-webkit-scroll-snap-type']");
58         shouldBeEqualToString("window.getComputedStyle(lockUpSnapCoordinate).getPropertyValue('-webkit-scroll-snap-type')", "mandatory");
59         shouldBeEmptyString("lockUpSnapCoordinate.style['-webkit-scroll-snap-points-x']");
60         shouldBeEqualToString("window.getComputedStyle(lockUpSnapCoordinate).getPropertyValue('-webkit-scroll-snap-points-x')", "repeat(100%)");
61         shouldBeEmptyString("lockUpSnapCoordinate.style['-webkit-scroll-snap-points-y']");
62         shouldBeEqualToString("window.getComputedStyle(lockUpSnapCoordinate).getPropertyValue('-webkit-scroll-snap-points-y')", "repeat(100%)");
63         shouldBeEmptyString("lockUpSnapCoordinate.style['-webkit-scroll-snap-destination']");
64         shouldBeEqualToString("window.getComputedStyle(lockUpSnapCoordinate).getPropertyValue('-webkit-scroll-snap-destination')", "100% 100%");
65         shouldBeEmptyString("lockUpSnapCoordinate.style['-webkit-scroll-snap-coordinate']");
66         shouldBeEqualToString("window.getComputedStyle(lockUpSnapCoordinate).getPropertyValue('-webkit-scroll-snap-coordinate')", "none");
67         </script>
68         <script src="../../../resources/js-test-post.js"></script>
69     </body>
70 </html>
71