pub type Transform = Transform<TransformOperation>;
Expand description
A specified CSS transform
Aliased Type§
struct Transform(pub OwnedSlice<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>);
Fields§
§0: OwnedSlice<GenericTransformOperation<Angle, Number, Length, Integer, LengthPercentage>>
Implementations§
source§impl Transform
impl Transform
sourcefn parse_internal<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>>
fn parse_internal<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<Self, ParseError<'i>>
Internal parse function for deciding if we wish to accept prefixed values or not
transform
allows unitless zero angles as an exception, see:
https://github.com/w3c/csswg-drafts/issues/1162
source§impl<T: ToMatrix> Transform<T>
impl<T: ToMatrix> Transform<T>
sourcepub fn to_transform_3d_matrix(
&self,
reference_box: Option<&Rect<ComputedLength>>
) -> Result<(Transform3D<CSSFloat>, bool), ()>
pub fn to_transform_3d_matrix( &self, reference_box: Option<&Rect<ComputedLength>> ) -> Result<(Transform3D<CSSFloat>, bool), ()>
Return the equivalent 3d matrix of this transform list.
We return a pair: the first one is the transform matrix, and the second one indicates if there is any 3d transform function in this transform list.
sourcepub fn components_to_transform_3d_matrix(
ops: &[T],
reference_box: Option<&Rect<ComputedLength>>
) -> Result<(Transform3D<CSSFloat>, bool), ()>
pub fn components_to_transform_3d_matrix( ops: &[T], reference_box: Option<&Rect<ComputedLength>> ) -> Result<(Transform3D<CSSFloat>, bool), ()>
Converts a series of components to a 3d matrix.
sourcepub fn to_transform_3d_matrix_f64(
&self,
reference_box: Option<&Rect<ComputedLength>>
) -> Result<(Transform3D<f64>, bool), ()>
pub fn to_transform_3d_matrix_f64( &self, reference_box: Option<&Rect<ComputedLength>> ) -> Result<(Transform3D<f64>, bool), ()>
Same as Transform::to_transform_3d_matrix but a f64 version.
fn components_to_transform_3d_matrix_f64( ops: &[T], reference_box: Option<&Rect<ComputedLength>> ) -> Result<(Transform3D<f64>, bool), ()>
Trait Implementations§
source§impl<T: Clone> Clone for GenericTransform<T>
impl<T: Clone> Clone for GenericTransform<T>
source§fn clone(&self) -> GenericTransform<T>
fn clone(&self) -> GenericTransform<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for GenericTransform<T>
impl<T: Debug> Debug for GenericTransform<T>
source§impl<'de, T> Deserialize<'de> for GenericTransform<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for GenericTransform<T>where T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T> MallocSizeOf for GenericTransform<T>where
T: MallocSizeOf,
impl<T> MallocSizeOf for GenericTransform<T>where T: MallocSizeOf,
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl Parse for Transform
impl Parse for Transform
source§fn parse<'i, 't>(
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>
) -> Result<Self, ParseError<'i>>
fn parse<'i, 't>( context: &ParserContext<'_>, input: &mut Parser<'i, 't> ) -> Result<Self, ParseError<'i>>
Parse a value of this type. Read more
source§impl<T: PartialEq> PartialEq<GenericTransform<T>> for GenericTransform<T>
impl<T: PartialEq> PartialEq<GenericTransform<T>> for GenericTransform<T>
source§fn eq(&self, other: &GenericTransform<T>) -> bool
fn eq(&self, other: &GenericTransform<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> Serialize for GenericTransform<T>where
T: Serialize,
impl<T> Serialize for GenericTransform<T>where T: Serialize,
source§impl<T> SpecifiedValueInfo for GenericTransform<T>where
T: SpecifiedValueInfo,
impl<T> SpecifiedValueInfo for GenericTransform<T>where T: SpecifiedValueInfo,
source§const SUPPORTED_TYPES: u8 = _
const SUPPORTED_TYPES: u8 = _
Supported CssTypes by the given value type. Read more
source§impl<T> ToComputedValue for GenericTransform<T>where
T: ToComputedValue,
impl<T> ToComputedValue for GenericTransform<T>where T: ToComputedValue,
§type ComputedValue = GenericTransform<<T as ToComputedValue>::ComputedValue>
type ComputedValue = GenericTransform<<T as ToComputedValue>::ComputedValue>
The computed value type we’re going to be converted to.
source§fn from_computed_value(from: &Self::ComputedValue) -> Self
fn from_computed_value(from: &Self::ComputedValue) -> Self
Convert a computed value to specified value form. Read more
source§fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
fn to_computed_value(&self, context: &Context<'_>) -> Self::ComputedValue
Convert a specified value to a computed value, using itself and the data
inside the
Context
.source§impl<T> ToCss for GenericTransform<T>where
T: ToCss,
impl<T> ToCss for GenericTransform<T>where T: ToCss,
source§impl<T> ToResolvedValue for GenericTransform<T>where
T: ToResolvedValue,
impl<T> ToResolvedValue for GenericTransform<T>where T: ToResolvedValue,
§type ResolvedValue = GenericTransform<<T as ToResolvedValue>::ResolvedValue>
type ResolvedValue = GenericTransform<<T as ToResolvedValue>::ResolvedValue>
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.