Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<style>
body {
margin: 0;
height: 5000px;
}
</style>
<script>
promiseTest(async () => {
await animationFrame();
await animationFrame();
await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");
await internals.wheelThroughUIProcess(50, 50, 0, 50, true, "ongoing");
await internals.wheelThroughUIProcess(50, 50, 0, 40, true, "momentum");
await animationFrame();
await animationFrame();
// A smooth scroll of the script's takes over from the momentum, whose rest scrolls nothing.
const smoothScrollEnded = scrollendEvent(document);
window.scrollTo({ top: 1000, behavior: "smooth" });
await animationFrame();
await animationFrame();
for (let step = 0; step < 3; step++)
await internals.wheelThroughUIProcess(50, 50, 0, 40, true, "momentum");
internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ended");
await smoothScrollEnded;
for (let frame = 0; frame < 4; frame++)
await animationFrame();
println(`scrollY after the smooth scroll: ${window.scrollY}`);
});
</script>