style: Take down the global animatable props list and use a kwarg instead

This commit is contained in:
Emilio Cobos Álvarez 2016-06-28 14:14:35 +00:00
parent 793de6dff2
commit faed3df594
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
25 changed files with 393 additions and 238 deletions

View file

@ -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]