mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
style: Take down the global animatable props list and use a kwarg instead
This commit is contained in:
parent
793de6dff2
commit
faed3df594
25 changed files with 393 additions and 238 deletions
|
@ -20,6 +20,7 @@ use properties::longhands::box_shadow::computed_value::BoxShadow;
|
|||
use properties::longhands::transform::computed_value::ComputedMatrix;
|
||||
use properties::longhands::transform::computed_value::ComputedOperation as TransformOperation;
|
||||
use properties::longhands::transform::computed_value::T as TransformList;
|
||||
use properties::longhands::transform_origin::computed_value::T as TransformOrigin;
|
||||
use properties::longhands::vertical_align::computed_value::T as VerticalAlign;
|
||||
use properties::longhands::visibility::computed_value::T as Visibility;
|
||||
use properties::longhands::z_index::computed_value::T as ZIndex;
|
||||
|
@ -821,6 +822,31 @@ impl Interpolate for LengthOrNone {
|
|||
}
|
||||
}
|
||||
|
||||
impl Interpolate for TransformOrigin {
|
||||
fn interpolate(&self, other: &Self, time: f64) -> Option<Self> {
|
||||
let horizontal = match self.horizontal.interpolate(&other.horizontal, time) {
|
||||
Some(h) => h,
|
||||
None => return None,
|
||||
};
|
||||
|
||||
let vertical = match self.vertical.interpolate(&other.vertical, time) {
|
||||
Some(v) => v,
|
||||
None => return None,
|
||||
};
|
||||
|
||||
let depth = match self.depth.interpolate(&other.depth, time) {
|
||||
Some(d) => d,
|
||||
None => return None,
|
||||
};
|
||||
|
||||
Some(TransformOrigin {
|
||||
horizontal: horizontal,
|
||||
vertical: vertical,
|
||||
depth: depth,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transforms/#interpolation-of-transforms
|
||||
impl Interpolate for TransformList {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue