mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Remove some more individual-transform dead code.
Differential Revision: https://phabricator.services.mozilla.com/D31705
This commit is contained in:
parent
57998eacc5
commit
8c8ef22e6b
2 changed files with 0 additions and 104 deletions
|
@ -2197,38 +2197,6 @@ fn static_assert() {
|
|||
${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
|
||||
|
|
|
@ -548,80 +548,8 @@ impl ToAnimatedZero for Transform {
|
|||
/// 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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue