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

@ -173,8 +173,6 @@ public:
virtual void set_viewport_size(CSSPixelSize);
void perform_scroll_of_viewport(CSSPixelPoint position);
void set_needs_display(InvalidateDisplayList = InvalidateDisplayList::Yes);
// https://html.spec.whatwg.org/#rendering-opportunity
[[nodiscard]] bool has_a_rendering_opportunity() const;