diff options
author | Martin Robinson <mrobinson@igalia.com> | 2020-05-11 19:07:24 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2020-05-17 20:42:57 +0200 |
commit | 183f15d5aacd290aa2bd2c3a2397cd456d170161 (patch) | |
tree | c8f34f53f303c8e2074fc674479cdd5b2a41d655 /components/style/matching.rs | |
parent | 0a00ea3db3c2353c78435030040fd3f57f5f4497 (diff) | |
download | servo-183f15d5aacd290aa2bd2c3a2397cd456d170161.tar.gz servo-183f15d5aacd290aa2bd2c3a2397cd456d170161.zip |
Implement `animation-fill-mode`
Fixes #26460.
Diffstat (limited to 'components/style/matching.rs')
-rw-r--r-- | components/style/matching.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/style/matching.rs b/components/style/matching.rs index e01adda303e..677f024acfa 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -7,6 +7,7 @@ #![allow(unsafe_code)] #![deny(missing_docs)] +use crate::animation::AnimationState; use crate::computed_value_flags::ComputedValueFlags; use crate::context::{ElementCascadeInputs, QuirksMode, SelectorFlagsMap}; use crate::context::{SharedStyleContext, StyleContext}; @@ -458,9 +459,14 @@ trait PrivateMatchMethods: TElement { &context.thread_local.font_metrics_provider, ); + // We clear away any finished transitions, but retain animations, because they + // might still be used for proper calculation of `animation-fill-mode`. + animation_state + .transitions + .retain(|transition| transition.state != AnimationState::Finished); + // If the ElementAnimationSet is empty, and don't store it in order to // save memory and to avoid extra processing later. - animation_state.clear_finished_animations(); if !animation_state.is_empty() { animation_states.insert(this_opaque, animation_state); } |