Commit Graph

2 Commits

Author SHA1 Message Date
Jelle Raaijmakers
fead8b92f9 LibWeb: Use correct scrollability check for autoscrolling
We only checked if the paintable box had scrollable overflow, but that
was too simple - we now use the same logic that checks whether a box can
be scrolled by a mousewheel event.

The autoscrolling test was updated as well to use rAF+rAF+timeout
instead of a fixed 1000ms timeout, which is prone to flakiness.
2026-03-24 13:55:37 +01:00
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