mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
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.
This commit is contained in:
parent
3c41bdbf92
commit
c50e89bb73
Notes:
github-actions[bot]
2025-01-21 20:08:44 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/c50e89bb736 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3336 Reviewed-by: https://github.com/gmta
1 changed files with 0 additions and 3 deletions
|
@ -1978,7 +1978,6 @@ void Element::invalidate_style_after_attribute_change(FlyString const& attribute
|
||||||
|
|
||||||
if (attribute_name == HTML::AttributeNames::style) {
|
if (attribute_name == HTML::AttributeNames::style) {
|
||||||
force_self_invalidation = ForceSelfStyleInvalidation::Yes;
|
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_) {
|
} else if (attribute_name == HTML::AttributeNames::class_) {
|
||||||
Vector<StringView> old_classes;
|
Vector<StringView> old_classes;
|
||||||
Vector<StringView> new_classes;
|
Vector<StringView> 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::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) {
|
} else if (attribute_name == HTML::AttributeNames::id) {
|
||||||
if (old_value.has_value())
|
if (old_value.has_value())
|
||||||
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .value = FlyString(old_value.value()) });
|
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .value = FlyString(old_value.value()) });
|
||||||
if (new_value.has_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::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) {
|
} 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::Disabled });
|
||||||
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::Enabled });
|
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::PseudoClass, .value = CSS::PseudoClass::Enabled });
|
||||||
|
|
Loading…
Reference in a new issue