From 064b7a62169e9b2302344447b201ef43acd293b7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 8 May 2023 10:20:16 +0200 Subject: [PATCH] LibWeb: Make HTMLObjectElement invalidate the document layout This is an oversized hammer for sure, but we have to make sure the layout tree gets rebuilt in case the object representation changes. Since "throw out the entire layout tree" is the finest tool we have right now, it'll have to do. This fixes an issue where the eyes on Acid2 would sometimes not show up until the next layout invalidation occurred. --- Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 2ca5c72a83..7dd9496755 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -339,8 +339,8 @@ void HTMLObjectElement::update_layout_and_child_objects(Representation represent } m_representation = representation; - set_needs_style_update(true); - document().set_needs_layout(); + invalidate_style(); + document().invalidate_layout(); } // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex