mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 16:28:54 +00:00
LibWeb: Compute invalidation before value is moved
`set_animated_property` will move `new_animated_value` away so we need to compute invalidation before we call it
This commit is contained in:
parent
3c808de270
commit
cecd5b3b5b
Notes:
github-actions[bot]
2025-08-22 10:19:11 +00:00
Author: https://github.com/Calme1709
Commit: cecd5b3b5b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5950
Reviewed-by: https://github.com/gmta ✅
1 changed files with 2 additions and 2 deletions
|
@ -821,13 +821,13 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_inherited_style()
|
|||
RefPtr<CSS::StyleValue const> old_animated_value = computed_properties->animated_property_values().get(property_id).value_or({});
|
||||
RefPtr<CSS::StyleValue const> new_animated_value = CSS::StyleComputer::get_animated_inherit_value(property_id, this).map([&](auto& value) { return value.ptr(); }).value_or({});
|
||||
|
||||
invalidation |= CSS::compute_property_invalidation(property_id, old_animated_value, new_animated_value);
|
||||
|
||||
if (new_animated_value)
|
||||
computed_properties->set_animated_property(property_id, new_animated_value.release_nonnull(), CSS::ComputedProperties::Inherited::Yes);
|
||||
else if (old_animated_value && computed_properties->is_animated_property_inherited(property_id))
|
||||
computed_properties->remove_animated_property(property_id);
|
||||
|
||||
invalidation |= CSS::compute_property_invalidation(property_id, old_animated_value, new_animated_value);
|
||||
|
||||
RefPtr new_value = CSS::StyleComputer::get_inherit_value(property_id, this);
|
||||
computed_properties->set_property(property_id, *new_value, CSS::ComputedProperties::Inherited::Yes);
|
||||
invalidation |= CSS::compute_property_invalidation(property_id, old_value, new_value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue