LibWeb: Fix infinite repaint loop when cached display list is used

Before this change, `m_needs_repaint` was reset in
`Document::record_display_list()` only when the cached display list was
absent. This meant that if the last triggered repaint used the cached
display list, we would keep repainting indefinitely until the display
list was invalidated (We schedule a task that checks if repainting is
required 60/s).

This change also moves `m_needs_repaint` from Document to
TraversableNavigable as we only ever need to repaint a document that
belongs to traversable.
This commit is contained in:
Aliaksandr Kalenik 2025-02-01 19:33:18 +01:00 committed by Andreas Kling
commit 0c5b61b7e1
Notes: github-actions[bot] 2025-02-01 22:32:14 +00:00
9 changed files with 17 additions and 25 deletions

View file

@ -1429,6 +1429,8 @@ NonnullRefPtr<Gfx::PaintingSurface> TraversableNavigable::painting_surface_for_b
void TraversableNavigable::paint(DevicePixelRect const& content_rect, Painting::BackingStore& target, PaintOptions paint_options)
{
m_needs_repaint = false;
auto document = active_document();
if (!document)
return;