From 1ac011668818e3743d309cc135eeaaa2cb9fb67a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 16 Mar 2022 12:33:51 +0100 Subject: [PATCH] LibWeb: Invalidate layout on BrowsingContext resize Even if style didn't change, we still need to force a layout, since the initial containing block depends on the viewport size. --- Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 9291176ce9..c9ea049b27 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021, Andreas Kling + * Copyright (c) 2018-2022, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ @@ -101,6 +101,7 @@ void BrowsingContext::set_viewport_rect(Gfx::IntRect 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(); } did_change = true; }