LibWeb: Cancel previous animation if new animation-name is "none"
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macOS, macos-15, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macOS, macOS-arm64, macos-15) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, Linux, Linux-x86_64, blacksmith-8vcpu-ubuntu-2404) (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

"none" value should be interpreted as "no animation" to trigger the path
that cancels previous animation if it exists.
This commit is contained in:
Aliaksandr Kalenik 2025-05-27 17:09:39 +02:00 committed by Alexander Kalenik
parent 985434ea10
commit 4b4d960cba
Notes: github-actions[bot] 2025-06-01 03:03:12 +00:00
3 changed files with 42 additions and 0 deletions

View file

@ -2678,6 +2678,8 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::Element& elem
auto const animation_name = computed_style->maybe_null_property(PropertyID::AnimationName);
if (!animation_name)
return OptionalNone {};
if (animation_name->is_keyword() && animation_name->to_keyword() == Keyword::None)
return OptionalNone {};
if (animation_name->is_string())
return animation_name->as_string().string_value().to_string();
return animation_name->to_string(SerializationMode::Normal);