From b9e03f3f4ba33c782f69c31dbc4cb4d9ce1fe0de Mon Sep 17 00:00:00 2001 From: rwakulszowa Date: Mon, 24 Oct 2016 12:19:10 +0200 Subject: [PATCH] Integer handling; products --- components/style/properties/longhand/font.mako.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index f31ecb10335..435a4dafc6a 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -361,7 +361,7 @@ ${helpers.single_keyword("font-variant-position", gecko_constant_prefix="NS_FONT_VARIANT_POSITION", animatable=False)} -<%helpers:longhand name="font-feature-settings" animatable="False"> +<%helpers:longhand name="font-feature-settings" products="none" animatable="False"> use cssparser::ToCss; use std::fmt; use values::NoViewportPercentage; @@ -420,15 +420,14 @@ ${helpers.single_keyword("font-variant-position", pub fn parse(input: &mut Parser) -> Result { let tag = try!(input.expect_string()).into_owned(); - if input.try(|input| input.expect_integer()).is_ok() { + if let Ok(value) = input.try(|input| input.expect_integer()) { // handle integer, throw if it is negative - let value = 4; //TODO: capture parsed input here if value >= 0 { Ok(FeatureTagValue{ tag: tag, value: value }) } else { Err(()) } - } else if input.try(|input| input.expect_ident_matching("off")).is_ok() { + } else if let Ok(_) = input.try(|input| input.expect_ident_matching("off")) { // off is an alias for '0' Ok(FeatureTagValue{ tag: tag, value: 0 }) } else {