mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Better computation of animation keyframes
This begins to address #26625 by properly applying CSS variables during keyframe computation and no longer using `apply_declarations`. Instead, walk the declarations, combining them into IntermediateComputedKeyframe, maintaining declarations that modify CSS custom properties. Then compute a set of AnimationValues for each keyframe and use those to produce interpolated animation values.
This commit is contained in:
parent
83fa1b9eaa
commit
b875f14e86
69 changed files with 269 additions and 1609 deletions
|
@ -20,6 +20,8 @@ use crate::properties::ComputedValues;
|
|||
use crate::rule_tree::{CascadeLevel, StrongRuleNode};
|
||||
use crate::selector_parser::{PseudoElement, RestyleDamage};
|
||||
use crate::style_resolver::ResolvedElementStyles;
|
||||
use crate::style_resolver::{PseudoElementResolution, StyleResolverForElement};
|
||||
use crate::stylist::RuleInclusion;
|
||||
use crate::traversal_flags::TraversalFlags;
|
||||
use selectors::matching::ElementSelectorFlags;
|
||||
use servo_arc::{Arc, ArcBorrow};
|
||||
|
@ -199,8 +201,6 @@ trait PrivateMatchMethods: TElement {
|
|||
primary_style: &Arc<ComputedValues>,
|
||||
) -> Option<Arc<ComputedValues>> {
|
||||
use crate::context::CascadeInputs;
|
||||
use crate::style_resolver::{PseudoElementResolution, StyleResolverForElement};
|
||||
use crate::stylist::RuleInclusion;
|
||||
|
||||
let rule_node = primary_style.rules();
|
||||
let without_transition_rules = context
|
||||
|
@ -455,11 +455,18 @@ trait PrivateMatchMethods: TElement {
|
|||
// for all the keyframes. We only want to do this if we think that there's a
|
||||
// chance that the animations really changed.
|
||||
if needs_animations_update {
|
||||
let mut resolver = StyleResolverForElement::new(
|
||||
*self,
|
||||
context,
|
||||
RuleInclusion::All,
|
||||
PseudoElementResolution::IfApplicable,
|
||||
);
|
||||
|
||||
animation_set.update_animations_for_new_style::<Self>(
|
||||
*self,
|
||||
&shared_context,
|
||||
&new_values,
|
||||
&context.thread_local.font_metrics_provider,
|
||||
&mut resolver,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue