blob: 8fe30dd25fa124383dec4505b1b937de33665291 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<!DOCTYPE html>
<html class="reftest-wait reftest-no-flush">
<style>
#outer {
position: absolute;
overflow: scroll;
width: 50vw;
height: 90vh;
border: 1px solid black;
scrollbar-width: none;
}
#inner {
overflow-y: hidden;
width: 100%;
}
.spacer {
width: 60vw;
height: 5000px;
background-color: blue;
}
</style>
<div id="outer">
<div id="inner">
<div class="spacer"></div>
</div>
</div>
<script>
document.addEventListener('MozReftestInvalidate', async () => {
outer.style.width = "90vw";
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(resolve => requestAnimationFrame(resolve));
const scrollEndPromise = new Promise(resolve => outer.addEventListener("scrollend", resolve));
outer.scrollBy({ top: 5000, behavior: "smooth" });
await scrollEndPromise;
document.documentElement.classList.remove('reftest-wait');
}, false);
</script>
</html>
|