| <html> |
| |
| <head> |
| <style> |
| #gallery { |
| width: 515px; |
| height: 500px; |
| -webkit-scroll-snap-type: mandatory; |
| -webkit-overflow-scrolling: touch; |
| -webkit-scroll-snap-points-y: repeat(500px); |
| overflow-y: scroll; |
| position: absolute; |
| } |
| |
| .vertical { |
| width: 500px; |
| height: 500px; |
| } |
| |
| #child00 { background-color: #DD0000; } |
| #child01 { background-color: #FF6666; } |
| #child02 { background-color: #00DD00; } |
| #child03 { background-color: #66FF66; } |
| #child04 { background-color: #0000DD; } |
| #child05 { background-color: #6666FF; } |
| </style> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| function setup() { |
| var gallery = document.getElementById("gallery"); |
| |
| function snapOffsets() { |
| return window.internals.scrollSnapOffsets(gallery); |
| } |
| |
| // Test starts here. Each function call triggers the next. |
| function dumpSnapOffsetsAndUpdatePointsY() { |
| debug("Original snap offsets: " + snapOffsets()); |
| gallery.style.webkitScrollSnapPointsY = "repeat(1000px)"; |
| setTimeout(dumpSnapOffsetsAndUpdateDestination, 0); |
| } |
| |
| function dumpSnapOffsetsAndUpdateDestination() { |
| debug("Updated points-y to repeat(1000px): " + snapOffsets()); |
| gallery.style.webkitScrollSnapDestination = "0px 250px"; |
| setTimeout(dumpSnapOffsetsAndUpdateType, 0); |
| } |
| |
| function dumpSnapOffsetsAndUpdateType() { |
| debug("Updated destination to 0px 250px: " + snapOffsets()); |
| gallery.style.webkitScrollSnapType = "none"; |
| setTimeout(dumpSnapOffsetsAndFinishTest, 0); |
| } |
| |
| function dumpSnapOffsetsAndFinishTest() { |
| debug("Updated type to none:" + snapOffsets()); |
| finishJSTest(); |
| testRunner.notifyDone(); |
| } |
| |
| if (window.testRunner) { |
| window.jsTestIsAsync = true; |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| setTimeout(dumpSnapOffsetsAndUpdatePointsY, 0); |
| } |
| } |
| </script> |
| </head> |
| |
| <body onload="setup()"> |
| <div id="gallery"> |
| <div class="vertical" id="child00"></div> |
| <div class="vertical" id="child01"></div> |
| <div class="vertical" id="child02"></div> |
| <div class="vertical" id="child03"></div> |
| <div class="vertical" id="child04"></div> |
| <div class="vertical" id="child05"></div> |
| </div> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| |
| </html> |