1
0
Fork 0
firefox/testing/web-platform/tests/css/css-view-transitions/reset-state-after-scrolled-view-transition-ref.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

39 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>Reference: Finishing a View Transition on a scrolled page should properly reset state</title>
<style>
html {
background: lightblue;
}
body {
background-color: lightgreen;
}
</style>
</head>
<body>
<p>Start</p>
<div style="height: 200vh"></div>
<p>End</p>
<script>
function scrollBy(y) {
return new Promise(resolve => {
addEventListener("scroll", () => {
requestAnimationFrame(() => {
requestAnimationFrame(resolve);
});
}, { once: true, capture: true });
document.documentElement.scrollBy({
top: y,
behavior: "instant"
});
});
}
addEventListener("load", async () => {
await scrollBy(document.documentElement.scrollHeight);
document.documentElement.classList.remove("reftest-wait");
});
</script>
</body>
</html>