From b19e1349998d55968dfd09cc745ed7692e11ed74 Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Sat, 9 Apr 2022 21:38:24 +0200 Subject: [PATCH] LibWeb: Invalidate layout after the computed font changes If the font resource finishes loading we need to make sure the element using it gets a chance to re-layout, even if the font-family property didn't change. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 6bce81f358..8983adbd65 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -327,6 +327,8 @@ enum class RequiredInvalidation { static RequiredInvalidation compute_required_invalidation(CSS::StyleProperties const& old_style, CSS::StyleProperties const& new_style) { + if (&old_style.computed_font() != &new_style.computed_font()) + return RequiredInvalidation::Relayout; bool requires_repaint = false; bool requires_stacking_context_tree_rebuild = false; for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) {