| animation-fill-mode: forwards; |
| animation-timing-function: step-start; |
| -webkit-animation-trigger: container-scroll(20px); |
| @-webkit-keyframes slide { |
| window.testRunner.dumpAsText(); |
| window.testRunner.waitUntilDone(); |
| results = document.getElementById("results"); |
| box = document.getElementById("box"); |
| results.innerHTML = "Value before animation is applied: " + window.getComputedStyle(box).left + " (should be auto)<br>"; |
| box.className = "animating"; |
| setTimeout(checkValueWithoutScroll, 0); |
| function checkValueWithoutScroll() { |
| results.innerHTML += "Value with animation but no scroll: " + window.getComputedStyle(box).left + " (should be 0px)<br>"; |
| setTimeout(checkValueWithScroll, 0); |
| function checkValueWithScroll() { |
| results.innerHTML += "Value with animation after scroll: " + window.getComputedStyle(box).left + " (should be 100px)<br>"; |
| window.testRunner.notifyDone(); |
| window.addEventListener("load", runTest, false); |
| <p>This element should begin animating only when the page scrolls to 20px from |
| the top. The animation is almost instantaneous, so it will snap to its final |
| position. Remember to scroll to the top of the page before reloading!</p> |