style: Implement transform: perspective(none)

Differential Revision: https://phabricator.services.mozilla.com/D123350
This commit is contained in:
Emilio Cobos Álvarez 2023-05-22 15:05:17 +02:00 committed by Oriol Brufau
parent ce45f68d9c
commit fa840e1666
4 changed files with 72 additions and 19 deletions

View file

@ -24,6 +24,9 @@ pub type Transform = generic::GenericTransform<TransformOperation>;
pub type TransformOrigin =
generic::GenericTransformOrigin<LengthPercentage, LengthPercentage, Length>;
/// The computed value of the `perspective()` transform function.
pub type PerspectiveFunction = generic::PerspectiveFunction<Length>;
/// A vector to represent the direction vector (rotate axis) for Rotate3D.
pub type DirectionVector = Vector3D<CSSFloat>;
@ -517,7 +520,7 @@ impl ToAnimatedZero for TransformOperation {
Ok(generic::TransformOperation::Rotate(Angle::zero()))
},
generic::TransformOperation::Perspective(_) => Ok(
generic::TransformOperation::Perspective(Length::new(std::f32::INFINITY))
generic::TransformOperation::Perspective(generic::PerspectiveFunction::None)
),
generic::TransformOperation::AccumulateMatrix { .. } |
generic::TransformOperation::InterpolateMatrix { .. } => {