mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
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:
parent
0cfe90b59e
commit
0c5b61b7e1
Notes:
github-actions[bot]
2025-02-01 22:32:14 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 0c5b61b7e1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3425
Reviewed-by: https://github.com/awesomekling ✅
9 changed files with 17 additions and 25 deletions
|
@ -411,13 +411,13 @@ void EventLoop::update_the_rendering()
|
|||
for (auto& document : docs) {
|
||||
document->page().client().process_screenshot_requests();
|
||||
auto navigable = document->navigable();
|
||||
if (navigable && document->needs_repaint()) {
|
||||
auto* browsing_context = document->browsing_context();
|
||||
auto& page = browsing_context->page();
|
||||
if (navigable->is_traversable()) {
|
||||
VERIFY(page.client().is_ready_to_paint());
|
||||
page.client().paint_next_frame();
|
||||
}
|
||||
if (!navigable->is_traversable())
|
||||
continue;
|
||||
auto traversable = navigable->traversable_navigable();
|
||||
if (traversable && traversable->needs_repaint()) {
|
||||
auto& page = traversable->page();
|
||||
VERIFY(page.client().is_ready_to_paint());
|
||||
page.client().paint_next_frame();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue