From c50e89bb73699bb3dd9e07648a577c1cf9cdc29e Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Tue, 21 Jan 2025 16:46:44 +0100 Subject: [PATCH] LibWeb: Don't include changed attribute twice in `changed_properties` Changed attribute name is always added into this list right before `invalidate_style()` is called. --- Libraries/LibWeb/DOM/Element.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 12b8c28912e..b4897b1f8bc 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -1978,7 +1978,6 @@ void Element::invalidate_style_after_attribute_change(FlyString const& attribute if (attribute_name == HTML::AttributeNames::style) { force_self_invalidation = ForceSelfStyleInvalidation::Yes; - changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Attribute, .value = HTML::AttributeNames::style }); } else if (attribute_name == HTML::AttributeNames::class_) { Vector old_classes; Vector new_classes; @@ -1996,13 +1995,11 @@ void Element::invalidate_style_after_attribute_change(FlyString const& attribute changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Class, .value = FlyString::from_utf8_without_validation(new_class.bytes()) }); } } - changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Attribute, .value = HTML::AttributeNames::class_ }); } else if (attribute_name == HTML::AttributeNames::id) { if (old_value.has_value()) changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .value = FlyString(old_value.value()) }); if (new_value.has_value()) changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .value = FlyString(new_value.value()) }); - changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Attribute, .value = HTML::AttributeNames::id }); } else if (attribute_name == HTML::AttributeNames::disabled) { changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::Disabled }); changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::Enabled });