From b34dd0fb24fe74cd3686540c5f71c3c45c0641a8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 15 Feb 2022 13:01:48 +0100 Subject: [PATCH] LibWeb: Repaint entire viewport after document layout This fixes an issue with the eyes on ACID2 not appearing until the page is repainted after loading. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 +- Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 5 +++++ Userland/Libraries/LibWeb/HTML/BrowsingContext.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index fc49ffa2e0..cdafa8eee3 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -420,7 +420,7 @@ void Document::update_layout() root_formatting_context.run(*m_layout_root, Layout::LayoutMode::Default); - m_layout_root->set_needs_display(); + browsing_context()->set_needs_display(); if (browsing_context()->is_top_level()) { if (auto* page = this->page()) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 76a7ec5999..285aef278e 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -128,6 +128,11 @@ void BrowsingContext::set_viewport_scroll_offset(Gfx::IntPoint const& offset) client->browsing_context_did_set_viewport_rect(viewport_rect()); } +void BrowsingContext::set_needs_display() +{ + set_needs_display(viewport_rect()); +} + void BrowsingContext::set_needs_display(Gfx::IntRect const& rect) { if (!viewport_rect().intersects(rect)) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index b9b71debd5..bcb621a3a1 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -50,6 +50,7 @@ public: Gfx::IntSize const& size() const { return m_size; } void set_size(Gfx::IntSize const&); + void set_needs_display(); void set_needs_display(Gfx::IntRect const&); Gfx::IntPoint const& viewport_scroll_offset() const { return m_viewport_scroll_offset; }