From d58c1c1176332d3f402872cb3f7eeaf314714e2b Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 30 Jul 2024 15:48:27 +0100 Subject: [PATCH] LibWeb/CSS: Make `content` property change require full invalidation `content` determines the element or pseudo-element's layout, including its children. --- Userland/Libraries/LibWeb/CSS/StyleInvalidation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleInvalidation.cpp b/Userland/Libraries/LibWeb/CSS/StyleInvalidation.cpp index a9e663641e8..1e310416c6e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleInvalidation.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleInvalidation.cpp @@ -17,9 +17,9 @@ RequiredInvalidationAfterStyleChange compute_property_invalidation(CSS::Property if (!property_value_changed) return invalidation; - // NOTE: If the computed CSS display/content-visibility property changes, we have to rebuild the entire layout tree. + // NOTE: If the computed CSS display, content, or content-visibility property changes, we have to rebuild the entire layout tree. // In the future, we should figure out ways to rebuild a smaller part of the tree. - if (property_id == CSS::PropertyID::Display || property_id == CSS::PropertyID::ContentVisibility) { + if (AK::first_is_one_of(property_id, CSS::PropertyID::Display, CSS::PropertyID::Content, CSS::PropertyID::ContentVisibility)) { return RequiredInvalidationAfterStyleChange::full(); }