LibWeb: Don't play initially-paused animations
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Gingeh 2025-06-16 12:26:42 +10:00 committed by Jelle Raaijmakers
parent 6169e91994
commit e96338dd63
Notes: github-actions[bot] 2025-06-18 15:18:49 +00:00
11 changed files with 143 additions and 37 deletions

View file

@ -1281,7 +1281,7 @@ static void apply_animation_properties(DOM::Document& document, CascadedProperti
effect.set_playback_direction(Animations::css_animation_direction_to_bindings_playback_direction(direction));
if (play_state != effect.last_css_animation_play_state()) {
if (play_state == CSS::AnimationPlayState::Running && animation.play_state() == Bindings::AnimationPlayState::Paused) {
if (play_state == CSS::AnimationPlayState::Running && animation.play_state() != Bindings::AnimationPlayState::Running) {
HTML::TemporaryExecutionContext context(document.realm());
animation.play().release_value_but_fixme_should_propagate_errors();
} else if (play_state == CSS::AnimationPlayState::Paused && animation.play_state() != Bindings::AnimationPlayState::Paused) {
@ -2655,11 +2655,6 @@ 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_inclusive_ancestor_with_display_none()) {
HTML::TemporaryExecutionContext context(realm);
animation->play().release_value_but_fixme_should_propagate_errors();
}
} else {
// The animation hasn't changed, but some properties of the animation may have
if (auto animation = element.cached_animation_name_animation(pseudo_element); animation)