mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add an FFI function that returns an AnimationValue for a given nsCSSPropertyID from computed values.
When we compose style for a given nsCSSPropertyID in the case where we have no specified values in target keyframe, we use this AnimationValue for composition as if it's specified.
This commit is contained in:
parent
fb6aceba31
commit
97aacb242e
2 changed files with 26 additions and 0 deletions
|
@ -399,6 +399,23 @@ impl AnimationValue {
|
|||
_ => None // non animatable properties will get included because of shorthands. ignore.
|
||||
}
|
||||
}
|
||||
|
||||
/// Get an AnimationValue for a TransitionProperty from a given computed values.
|
||||
pub fn from_computed_values(transition_property: &TransitionProperty,
|
||||
computed_values: &ComputedValues)
|
||||
-> Self {
|
||||
match *transition_property {
|
||||
TransitionProperty::All => panic!("Can't use TransitionProperty::All here."),
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
TransitionProperty::${prop.camel_case} => {
|
||||
AnimationValue::${prop.camel_case}(
|
||||
computed_values.get_${prop.style_struct.ident.strip("_")}().clone_${prop.ident}())
|
||||
}
|
||||
% endif
|
||||
% endfor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Interpolate for AnimationValue {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue