--- a/servo/components/style/properties/helpers/animated_properties.mako.rs
+++ b/servo/components/style/properties/helpers/animated_properties.mako.rs
@@ -1264,26 +1264,92 @@ impl Animate for TransformOperation {
) => {
Ok(TransformOperation::Translate(
fx.animate(tx, procedure)?,
fy.animate(ty, procedure)?,
fz.animate(tz, procedure)?,
))
},
(
+ &TransformOperation::TranslateX(ref from),
+ &TransformOperation::TranslateX(ref to),
+ ) => {
+ Ok(TransformOperation::TranslateX(
+ from.animate(to, procedure)?,
+ ))
+ },
+ (
+ &TransformOperation::TranslateY(ref from),
+ &TransformOperation::TranslateY(ref to),
+ ) => {
+ Ok(TransformOperation::TranslateY(
+ from.animate(to, procedure)?,
+ ))
+ },
+ (
+ &TransformOperation::TranslateZ(ref from),
+ &TransformOperation::TranslateZ(ref to),
+ ) => {
+ Ok(TransformOperation::TranslateZ(
+ from.animate(to, procedure)?,
+ ))
+ },
+ (
&TransformOperation::Scale(ref fx, ref fy, ref fz),
&TransformOperation::Scale(ref tx, ref ty, ref tz),
) => {
Ok(TransformOperation::Scale(
animate_multiplicative_factor(*fx, *tx, procedure)?,
animate_multiplicative_factor(*fy, *ty, procedure)?,
animate_multiplicative_factor(*fz, *tz, procedure)?,
))
},
(
+ &TransformOperation::ScaleX(ref from),
+ &TransformOperation::ScaleX(ref to),
+ ) => {
+ Ok(TransformOperation::ScaleX(
+ animate_multiplicative_factor(*from, *to, procedure)?,
+ ))
+ },
+ (
+ &TransformOperation::ScaleY(ref from),
+ &TransformOperation::ScaleY(ref to),
+ ) => {
+ Ok(TransformOperation::ScaleY(
+ animate_multiplicative_factor(*from, *to, procedure)?,
+ ))
+ },
+ (
+ &TransformOperation::ScaleZ(ref from),
+ &TransformOperation::ScaleZ(ref to),
+ ) => {
+ Ok(TransformOperation::ScaleZ(
+ animate_multiplicative_factor(*from, *to, procedure)?,
+ ))
+ },
+ (
+ &TransformOperation::RotateX(ref from),
+ &TransformOperation::RotateX(ref to),
+ ) => {
+ Ok(TransformOperation::RotateX(from.animate(to, procedure)?))
+ },
+ (
+ &TransformOperation::RotateY(ref from),
+ &TransformOperation::RotateY(ref to),
+ ) => {
+ Ok(TransformOperation::RotateY(from.animate(to, procedure)?))
+ },
+ (
+ &TransformOperation::RotateZ(ref from),
+ &TransformOperation::RotateZ(ref to),
+ ) => {
+ Ok(TransformOperation::RotateZ(from.animate(to, procedure)?))
+ },
+ (
&TransformOperation::Rotate(fx, fy, fz, fa),
&TransformOperation::Rotate(tx, ty, tz, ta),
) => {
let (fx, fy, fz, fa) =
TransformList::get_normalized_vector_and_angle(fx, fy, fz, fa);
let (tx, ty, tz, ta) =
TransformList::get_normalized_vector_and_angle(tx, ty, tz, ta);
if (fx, fy, fz) == (tx, ty, tz) {
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -123,17 +123,17 @@ impl TransformList {
ComputedOperation::TranslateY(ty) => {
let ty = match reference_box {
Some(relative_border_box) => ty.to_used_value(relative_border_box.size.height).to_f32_px(),
None => extract_pixel_length(&ty),
};
Transform3D::create_translation(0., ty, 0.)
}
ComputedOperation::TranslateZ(tz) => {
- Transform3D::create_translation(0., 0., tz.to_f32_px())
+ Transform3D::create_translation(0., 0., tz.px())
}
ComputedOperation::Translate(tx, ty, tz) => {
let (tx, ty) = match reference_box {
Some(relative_border_box) => {
(tx.to_pixel_length(relative_border_box.size.width).px(),
ty.to_pixel_length(relative_border_box.size.height).px())
},
None => {