Files
ladybird/Tests/LibWeb/Text/input/viewport-auto-scroll.html
Jelle Raaijmakers 6c2583eade LibWeb: Implement mouse auto scrolling of scrollable containers
When the mouse is dragged from inside a scrollable container to outside
of it, we now automatically scroll the container so the selection can be
extended. Scroll speed scales with the distance past the scrollport
edge, capped at a maximum. Edges close to the viewport boundary get a
wider activation zone so the speed ramp works predictably even when the
mouse has limited room to move.

The logic is encapsulated in AutoScrollHandler, which EventHandler
creates lazily on mouse selection start.
2026-02-11 11:04:53 +01:00

26 lines
488 B
HTML

<!DOCTYPE html>
<style>
body {
margin: 0;
height: 5000px;
}
</style>
<script src="include.js"></script>
<script>
asyncTest(async (done) => {
let scrolled = new Promise(resolve => {
document.addEventListener("scroll", resolve, { once: true });
});
internals.mouseDown(100, 10);
internals.mouseMove(100, 610);
await scrolled;
println(`scrollTop: ${document.documentElement.scrollTop}`);
internals.mouseUp(100, 610);
done();
});
</script>