mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 21:57:18 +00:00
LibWeb: Use invalidation sets for id attribute style invalidation
This commit is contained in:
parent
c5f2a88f69
commit
039e0d478a
Notes:
github-actions[bot]
2025-01-19 18:55:44 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 039e0d478a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3292
Reviewed-by: https://github.com/awesomekling
1 changed files with 11 additions and 0 deletions
|
@ -2016,6 +2016,17 @@ void Element::invalidate_style_after_attribute_change(FlyString const& attribute
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attribute_name == HTML::AttributeNames::id) {
|
||||||
|
Vector<CSS::InvalidationSet::Property> changed_properties;
|
||||||
|
if (old_value.has_value())
|
||||||
|
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .name = old_value.value() });
|
||||||
|
if (new_value.has_value())
|
||||||
|
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Id, .name = new_value.value() });
|
||||||
|
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Attribute, .name = HTML::AttributeNames::id });
|
||||||
|
invalidate_style(StyleInvalidationReason::ElementAttributeChange, changed_properties);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_presentational_hint(attribute_name)
|
if (is_presentational_hint(attribute_name)
|
||||||
|| attribute_name_may_affect_selectors(*this, attribute_name)) {
|
|| attribute_name_may_affect_selectors(*this, attribute_name)) {
|
||||||
invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue