diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index ddb70e83d87..346add6c935 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -1912,14 +1912,14 @@ pub mod longhands { } /// | | | pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result { - let value = try!(input.try(specified::LengthOrPercentage::parse_non_negative)); - match value { + input.try(specified::LengthOrPercentage::parse_non_negative) + .and_then(|value| match value { specified::LengthOrPercentage::Length(value) => Ok(value), specified::LengthOrPercentage::Percentage(value) => Ok(specified::Length::FontRelative(specified::FontRelativeLength::Em(value.0))), // FIXME(dzbarsky) handle calc for font-size - specified::LengthOrPercentage::Calc(_) => return Err(()) - } + specified::LengthOrPercentage::Calc(_) => Err(()) + }) .or_else(|()| { match_ignore_ascii_case! { try!(input.expect_ident()), "xx-small" => Ok(specified::Length::Absolute(Au::from_px(MEDIUM_PX) * 3 / 5)), diff --git a/tests/ref/font_size.html b/tests/ref/font_size.html index 6d534378724..7c500513bcb 100644 --- a/tests/ref/font_size.html +++ b/tests/ref/font_size.html @@ -1,5 +1,6 @@ font-size (issues #1435, #3417) +

24pt is 32px.

2em is 40px. diff --git a/tests/ref/font_size_ref.html b/tests/ref/font_size_ref.html index 0c5d50fb8b7..62adacf79f3 100644 --- a/tests/ref/font_size_ref.html +++ b/tests/ref/font_size_ref.html @@ -1,5 +1,6 @@ font-size (issues #1435, #3417) +

24pt is 32px.

2em is 40px.