From e30709fca91715622a613fd5f1d998b760d441df Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 27 May 2023 09:56:00 +0200 Subject: LibWeb: Don't throw away the layout tree on viewport resize We'll throw it out automatically if some media query changes changes its evaluation state in response to the resize, and that should be enough. --- Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index d0f6122ce2..f5ac8a6b78 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -554,7 +554,7 @@ void BrowsingContext::set_viewport_rect(CSSPixelRect const& rect) if (auto* document = active_document()) { // NOTE: Resizing the viewport changes the reference value for viewport-relative CSS lengths. document->invalidate_style(); - document->invalidate_layout(); + document->set_needs_layout(); } did_change = true; } @@ -582,7 +582,7 @@ void BrowsingContext::set_size(CSSPixelSize size) if (auto* document = active_document()) { document->invalidate_style(); - document->invalidate_layout(); + document->set_needs_layout(); } for (auto* client : m_viewport_clients) -- cgit v1.2.3