style: Use Rust types for perspective and z-index.

Differential Revision: https://phabricator.services.mozilla.com/D20381
This commit is contained in:
Emilio Cobos Álvarez 2019-02-19 23:04:45 +00:00
parent 6428ed726d
commit 74d7d5bc42
8 changed files with 17 additions and 87 deletions

View file

@ -862,20 +862,6 @@ impl Parse for Contain {
/// A specified value for the `perspective` property.
pub type Perspective = GenericPerspective<NonNegativeLength>;
impl Parse for Perspective {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if input.try(|i| i.expect_ident_matching("none")).is_ok() {
return Ok(GenericPerspective::None);
}
Ok(GenericPerspective::Length(NonNegativeLength::parse(
context, input,
)?))
}
}
/// A given transition property, that is either `All`, a longhand or shorthand
/// property, or an unsupported or custom property.
#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue)]