Use helpers.predefined_type for transform property.

This commit is contained in:
Xidorn Quan 2017-11-03 15:19:56 +11:00
parent 0047c77f03
commit 79fb584eac
7 changed files with 46 additions and 52 deletions

View file

@ -567,42 +567,12 @@ ${helpers.predefined_type(
allow_empty="NotInitial"
)}
<%helpers:longhand name="transform" extra_prefixes="webkit"
animation_value_type="ComputedValue"
flags="CREATES_STACKING_CONTEXT FIXPOS_CB"
spec="https://drafts.csswg.org/css-transforms/#propdef-transform">
use values::generics::transform::Transform;
pub mod computed_value {
pub use values::computed::transform::Transform as T;
pub use values::computed::transform::TransformOperation as ComputedOperation;
}
pub use values::specified::transform::Transform as SpecifiedValue;
pub use values::specified::transform::TransformOperation as SpecifiedOperation;
#[inline]
pub fn get_initial_value() -> computed_value::T {
Transform(vec![])
}
/// Parses `transform` property.
#[inline]
pub fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<SpecifiedValue,ParseError<'i>> {
SpecifiedValue::parse_internal(context, input, false)
}
/// 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<SpecifiedValue,ParseError<'i>> {
SpecifiedValue::parse_internal(context, input, true)
}
</%helpers:longhand>
${helpers.predefined_type("transform", "Transform",
"generics::transform::Transform::none()",
extra_prefixes="webkit",
animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
spec="https://drafts.csswg.org/css-transforms/#propdef-transform")}
// CSSOM View Module
// https://www.w3.org/TR/cssom-view-1/