Bug 1552625 - Remove some more individual-transform dead code. r=boris
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 18 May 2019 04:48:16 +0000
changeset 533249 2d06ae6700d5be5988713669b4b9c4d91aeff3b0
parent 533248 777492b75f9745bd78dc96155ccd91523b788db0
child 533250 c07f5967e0fc880bb9db128e98369f648a1884e2
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1552625
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1552625 - Remove some more individual-transform dead code. r=boris Differential Revision: https://phabricator.services.mozilla.com/D31705
servo/components/style/properties/gecko.mako.rs
servo/components/style/values/computed/transform.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -2192,48 +2192,16 @@ fn static_assert() {
             _ => panic!("Found unexpected value for animation-${ident}"),
             % endif
         }
     }
     ${impl_animation_count(ident, gecko_ffi_name)}
     ${impl_copy_animation_value(ident, gecko_ffi_name)}
 </%def>
 
-<%def name="impl_individual_transform(ident, type, gecko_ffi_name)">
-    pub fn set_${ident}(&mut self, other: values::computed::${type}) {
-        unsafe { self.gecko.${gecko_ffi_name}.clear() };
-
-        if let Some(operation) = other.to_transform_operation() {
-            convert_transform(&[operation], &mut self.gecko.${gecko_ffi_name})
-        }
-    }
-
-    pub fn copy_${ident}_from(&mut self, other: &Self) {
-        unsafe { self.gecko.${gecko_ffi_name}.set(&other.gecko.${gecko_ffi_name}); }
-    }
-
-    pub fn reset_${ident}(&mut self, other: &Self) {
-        self.copy_${ident}_from(other)
-    }
-
-    pub fn clone_${ident}(&self) -> values::computed::${type} {
-        use crate::values::generics::transform::${type};
-
-        if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() {
-            return ${type}::None;
-        }
-
-        let list = unsafe { (*self.gecko.${gecko_ffi_name}.to_safe().get()).mHead.as_ref() };
-
-        let mut transform = clone_transform_from_list(list);
-        debug_assert_eq!(transform.0.len(), 1);
-        ${type}::from_transform_operation(&transform.0.pop().unwrap())
-    }
-</%def>
-
 <% skip_box_longhands= """display
                           animation-name animation-delay animation-duration
                           animation-direction animation-fill-mode animation-play-state
                           animation-iteration-count animation-timing-function
                           clear transition-duration transition-delay
                           transition-timing-function transition-property
                           transform-style scroll-snap-points-x
                           scroll-snap-points-y scroll-snap-coordinate
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -543,85 +543,13 @@ impl ToAnimatedZero for Transform {
                 .collect::<Result<crate::OwnedSlice<_>, _>>()?,
         ))
     }
 }
 
 /// A computed CSS `rotate`
 pub type Rotate = generic::GenericRotate<Number, Angle>;
 
-impl Rotate {
-    /// Convert TransformOperation to Rotate.
-    pub fn to_transform_operation(&self) -> Option<TransformOperation> {
-        match *self {
-            generic::Rotate::None => None,
-            generic::Rotate::Rotate(angle) => Some(generic::TransformOperation::Rotate(angle)),
-            generic::Rotate::Rotate3D(rx, ry, rz, angle) => {
-                Some(generic::TransformOperation::Rotate3D(rx, ry, rz, angle))
-            },
-        }
-    }
-
-    /// Convert Rotate to TransformOperation.
-    pub fn from_transform_operation(operation: &TransformOperation) -> Rotate {
-        match *operation {
-            generic::TransformOperation::Rotate(angle) => generic::Rotate::Rotate(angle),
-            generic::TransformOperation::Rotate3D(rx, ry, rz, angle) => {
-                generic::Rotate::Rotate3D(rx, ry, rz, angle)
-            },
-            _ => unreachable!("Found unexpected value for rotate property"),
-        }
-    }
-}
-
 /// A computed CSS `translate`
 pub type Translate = generic::GenericTranslate<LengthPercentage, Length>;
 
-impl Translate {
-    /// Convert TransformOperation to Translate.
-    pub fn to_transform_operation(&self) -> Option<TransformOperation> {
-        match *self {
-            generic::Translate::None => None,
-            generic::Translate::Translate(tx, ty) => {
-                Some(generic::TransformOperation::Translate(tx, ty))
-            },
-            generic::Translate::Translate3D(tx, ty, tz) => {
-                Some(generic::TransformOperation::Translate3D(tx, ty, tz))
-            },
-        }
-    }
-
-    /// Convert Translate to TransformOperation.
-    pub fn from_transform_operation(operation: &TransformOperation) -> Translate {
-        match *operation {
-            generic::TransformOperation::Translate(tx, ty) => generic::Translate::Translate(tx, ty),
-            generic::TransformOperation::Translate3D(tx, ty, tz) => {
-                generic::Translate::Translate3D(tx, ty, tz)
-            },
-            _ => unreachable!("Found unexpected value for translate"),
-        }
-    }
-}
-
 /// A computed CSS `scale`
 pub type Scale = generic::GenericScale<Number>;
-
-impl Scale {
-    /// Convert TransformOperation to Scale.
-    pub fn to_transform_operation(&self) -> Option<TransformOperation> {
-        match *self {
-            generic::Scale::None => None,
-            generic::Scale::Scale(sx, sy) => Some(generic::TransformOperation::Scale(sx, sy)),
-            generic::Scale::Scale3D(sx, sy, sz) => {
-                Some(generic::TransformOperation::Scale3D(sx, sy, sz))
-            },
-        }
-    }
-
-    /// Convert Scale to TransformOperation.
-    pub fn from_transform_operation(operation: &TransformOperation) -> Scale {
-        match *operation {
-            generic::TransformOperation::Scale(sx, sy) => generic::Scale::Scale(sx, sy),
-            generic::TransformOperation::Scale3D(sx, sy, sz) => generic::Scale::Scale3D(sx, sy, sz),
-            _ => unreachable!("Found unexpected value for scale"),
-        }
-    }
-}