LibWeb: Cancel animations when element is moved in display none subtree

We already have logic to play or cancel animations in an element's
subtree when the display property changes to or from none. However,
this was not sufficient to cover the case when an element starts/stops
being nested in display none after insertion.
This commit is contained in:
Aliaksandr Kalenik 2025-03-04 15:32:06 +01:00 committed by Alexander Kalenik
parent f148af0a93
commit b92a8553c7
Notes: github-actions[bot] 2025-03-04 17:37:15 +00:00
7 changed files with 126 additions and 64 deletions

View file

@ -2605,7 +2605,7 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::Element& elem
effect->set_target(&element);
element.set_cached_animation_name_animation(animation, pseudo_element);
if (!element.has_display_none_ancestor()) {
if (!element.has_inclusive_ancestor_with_display_none()) {
HTML::TemporaryExecutionContext context(realm);
animation->play().release_value_but_fixme_should_propagate_errors();
}