mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibWeb: Optimize style invalidation for presentational hint attributes
Use invalidation sets for presentational hint attribute invalidation instead of falling back to full descendants and siblings invalidation. The only difference for presentational hint attributes is that we always have to invalidate the style of element itself.
This commit is contained in:
parent
f3f1db7725
commit
3c41bdbf92
Notes:
github-actions[bot]
2025-01-21 20:08:52 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/3c41bdbf921 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3336 Reviewed-by: https://github.com/gmta
1 changed files with 3 additions and 4 deletions
|
@ -1970,13 +1970,12 @@ ErrorOr<void> Element::scroll_into_view(Optional<Variant<bool, ScrollIntoViewOpt
|
|||
|
||||
void Element::invalidate_style_after_attribute_change(FlyString const& attribute_name, Optional<String> const& old_value, Optional<String> const& new_value)
|
||||
{
|
||||
Vector<CSS::InvalidationSet::Property, 1> changed_properties;
|
||||
ForceSelfStyleInvalidation force_self_invalidation = ForceSelfStyleInvalidation::No;
|
||||
if (is_presentational_hint(attribute_name)) {
|
||||
invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
||||
return;
|
||||
force_self_invalidation = ForceSelfStyleInvalidation::Yes;
|
||||
}
|
||||
|
||||
Vector<CSS::InvalidationSet::Property> changed_properties;
|
||||
ForceSelfStyleInvalidation force_self_invalidation = ForceSelfStyleInvalidation::No;
|
||||
if (attribute_name == HTML::AttributeNames::style) {
|
||||
force_self_invalidation = ForceSelfStyleInvalidation::Yes;
|
||||
changed_properties.append({ .type = CSS::InvalidationSet::Property::Type::Attribute, .value = HTML::AttributeNames::style });
|
||||
|
|
Loading…
Reference in a new issue