mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Use helpers.predefined_type for transform property.
This commit is contained in:
parent
fad4d7ae49
commit
8b9bbfea75
7 changed files with 45 additions and 51 deletions
|
@ -39,7 +39,7 @@ pub type TransformOrigin = GenericTransformOrigin<OriginComponent<X>, OriginComp
|
|||
impl Transform {
|
||||
/// Internal parse function for deciding if we wish to accept prefixed values or not
|
||||
// Allow unitless zero angle for rotate() and skew() to align with gecko
|
||||
pub fn parse_internal<'i, 't>(
|
||||
fn parse_internal<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
prefixed: bool,
|
||||
|
@ -252,6 +252,25 @@ impl Transform {
|
|||
})
|
||||
})?))
|
||||
}
|
||||
|
||||
/// Parses `-moz-transform` property. This prefixed property also accepts LengthOrPercentage
|
||||
/// in the nondiagonal homogeneous components of matrix and matrix3d.
|
||||
#[inline]
|
||||
pub fn parse_prefixed<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Transform::parse_internal(context, input, true)
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for Transform {
|
||||
fn parse<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
Transform::parse_internal(context, input, false)
|
||||
}
|
||||
}
|
||||
|
||||
/// The specified value of a component of a CSS `<transform-origin>`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue