Commit Graph

4 Commits

Author SHA1 Message Date
Aliaksandr Kalenik
568b7ce7ea LibWeb: Make Paintable tree ref-counted
The Paintable tree and its supplemental painting data structures were
GC allocated because that was the easiest way to manage it and avoid
leaks introduced by ref cycles. This included the Paintable subclasses
themselves plus StackingContext, ChromeWidget, Scrollbar, ResizeHandle,
and scroll-frame state.

We are now trying to reduce GC allocation churn on layout and painting
updates, so keeping this short-lived rendering tree outside the JS heap
is a better fit. Move Paintable to RefCountedTreeNode, make painting
helpers ref-counted or weakly reference Paintables, and update the
layout and event-handler call sites to use RefPtr/WeakPtr ownership.
2026-05-07 15:03:44 +02:00
Johan Dahlin
38ef7e0180 LibWeb: Guard MiddleButtonScrollHandler destructor against stale layout
Calling document().paintable() asserts layout_is_up_to_date(), which
can fail when the handler is destroyed during a navigation.
Guard the repaint call so the destructor is safe to run regardless of
layout state.
2026-04-27 14:03:39 +02:00
Timothy Flynn
331815f327 LibWeb: Enable middle mouse autoscroll on middle mouse clicks
We previously supported autoscroll while the middle mouse button was
pressed. We now also support clicking the middle mouse button in-place
to begin autoscroll. Pressing any mouse button or the escape key will
exit this mode.
2026-04-15 13:37:43 -04:00
Timothy Flynn
1931636ac3 LibWeb: Support auto-scrolling contains when the middle mouse is pressed
When the middle mouse button is pressed, we can now scroll the pressed
container while moving the mouse around. We paint an indicator at the
pressed origin (as an overlay), as the scroll speed will depend upon the
distance between the moved mouse and that origin.
2026-04-13 13:01:45 -04:00