mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
LibWeb: Consider fill state before calling Animation::play()
Animation::play_state() does not consider the fill state, and thus will not return "Playing" for a fill-forward animation in the after phase. It is still valid for paused, as pausing is not affected by the fill mode.
This commit is contained in:
parent
5dfe99e247
commit
e6aef49ef3
21
Tests/LibWeb/Ref/css-keyframe-fill-forwards.html
Normal file
21
Tests/LibWeb/Ref/css-keyframe-fill-forwards.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!doctype html>
|
||||
<link rel="match" href="reference/css-keyframe-fill-forwards-ref.html" />
|
||||
<style>
|
||||
#foo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
animation: anim 1s linear forwards;
|
||||
}
|
||||
@keyframes anim {
|
||||
from {
|
||||
background-color: red;
|
||||
}
|
||||
to {
|
||||
background-color: blue;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div id="foo"></div>
|
||||
<script>
|
||||
document.getElementById("foo").getAnimations()[0].currentTime = 1500;
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
#foo {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: blue;
|
||||
}
|
||||
</style>
|
||||
<div id="foo"></div>
|
|
@ -1400,7 +1400,7 @@ static void apply_animation_properties(DOM::Document& document, StyleProperties&
|
|||
effect.set_playback_direction(Animations::css_animation_direction_to_bindings_playback_direction(direction));
|
||||
|
||||
HTML::TemporaryExecutionContext context(document.relevant_settings_object());
|
||||
if (play_state == CSS::AnimationPlayState::Running && animation.play_state() != Bindings::AnimationPlayState::Running) {
|
||||
if (play_state == CSS::AnimationPlayState::Running && !animation.is_relevant()) {
|
||||
animation.play().release_value_but_fixme_should_propagate_errors();
|
||||
} else if (play_state == CSS::AnimationPlayState::Paused && animation.play_state() != Bindings::AnimationPlayState::Paused) {
|
||||
animation.pause().release_value_but_fixme_should_propagate_errors();
|
||||
|
|
Loading…
Reference in a new issue