From 23561133aa66172c72f955c6042e318e52a64d8d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 28 Oct 2021 18:14:38 +0200 Subject: [PATCH] LibWeb: Always update layout (if needed) before painting --- Userland/Services/WebContent/PageHost.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 31cccb5ac1..811302b3cc 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -64,6 +64,10 @@ void PageHost::paint(const Gfx::IntRect& content_rect, Gfx::Bitmap& target) Gfx::Painter painter(target); Gfx::IntRect bitmap_rect { {}, content_rect.size() }; + auto* document = page().top_level_browsing_context().active_document(); + VERIFY(document); + document->update_layout(); + auto* layout_root = this->layout_root(); if (!layout_root) { painter.fill_rect(bitmap_rect, Color::White);