From 42873abe848fa7e93941d607034061f1fdbc34fe Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Sat, 9 Sep 2017 09:00:21 +0900 Subject: [PATCH] Simplify transition-property parser. --- .../helpers/animated_properties.mako.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 0bbadbf4cba8..759ba8ae0bb4 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -247,21 +247,15 @@ impl TransitionProperty { /// Parse a transition-property value. pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result> { let ident = input.expect_ident()?; - let supported = match_ignore_ascii_case! { &ident, - "all" => Ok(Some(TransitionProperty::All)), + match_ignore_ascii_case! { &ident, + "all" => Ok(TransitionProperty::All), % for prop in data.longhands + data.shorthands_except_all(): % if prop.transitionable: - "${prop.name}" => Ok(Some(TransitionProperty::${prop.camel_case})), + "${prop.name}" => Ok(TransitionProperty::${prop.camel_case}), % endif % endfor - "none" => Err(()), - _ => Ok(None), - }; - - match supported { - Ok(Some(property)) => Ok(property), - Ok(None) => CustomIdent::from_ident(ident, &[]).map(TransitionProperty::Unsupported), - Err(()) => Err(SelectorParseError::UnexpectedIdent(ident.clone()).into()), + "none" => Err(SelectorParseError::UnexpectedIdent(ident.clone()).into()), + _ => CustomIdent::from_ident(ident, &[]).map(TransitionProperty::Unsupported), } }