LibWeb: Move m_needs_repaint and record_display_list() in Document

Let's make document responsible for display list invalidation,
considering it already takes care of style and layout.
This commit is contained in:
Aliaksandr Kalenik 2024-08-19 02:06:52 +02:00 committed by Andreas Kling
parent ab76b99f1e
commit 69c6e07139
Notes: github-actions[bot] 2024-08-19 16:58:13 +00:00
16 changed files with 117 additions and 109 deletions

View file

@ -209,7 +209,7 @@ void EventLoop::process()
// loop processing.
for_each_fully_active_document_in_docs([&](DOM::Document& document) {
auto navigable = document.navigable();
if (navigable && !navigable->has_a_rendering_opportunity() && navigable->needs_repaint())
if (navigable && !navigable->has_a_rendering_opportunity() && document.needs_repaint())
schedule();
if (navigable && navigable->has_a_rendering_opportunity())
return;
@ -328,7 +328,7 @@ void EventLoop::process()
// 16. For each fully active Document in docs, update the rendering or user interface of that Document and its browsing context to reflect the current state.
for_each_fully_active_document_in_docs([&](DOM::Document& document) {
auto navigable = document.navigable();
if (navigable && navigable->needs_repaint()) {
if (navigable && document.needs_repaint()) {
auto* browsing_context = document.browsing_context();
auto& page = browsing_context->page();
if (navigable->is_traversable()) {
@ -341,7 +341,7 @@ void EventLoop::process()
// FIXME: Not in the spec: If there is a screenshot request queued, process it now.
// This prevents tests deadlocking on screenshot requests on macOS.
for (auto& document : docs) {
if (document->page().top_level_traversable()->needs_repaint())
if (document->needs_repaint())
document->page().client().process_screenshot_requests();
}