From efdc67d5a1705283fe4ff9ccb79c22af92edef0b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 18 Apr 2017 14:10:16 +0200 Subject: [PATCH] Properly parse background-size in background longhand (fixes #15199) --- components/style/properties/longhand/background.mako.rs | 8 +++----- .../css-backgrounds-3_dev/html4/background-332.htm.ini | 6 ------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index 1b33d7dd0be..994f70a0a25 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -494,11 +494,9 @@ ${helpers.single_keyword("background-origin", let width = try!(specified::LengthOrPercentageOrAuto::parse_non_negative(context, input)); - let height = if input.is_exhausted() { - specified::LengthOrPercentageOrAuto::Auto - } else { - try!(specified::LengthOrPercentageOrAuto::parse_non_negative(context, input)) - }; + let height = input.try(|input| { + specified::LengthOrPercentageOrAuto::parse_non_negative(context, input) + }).unwrap_or(specified::LengthOrPercentageOrAuto::Auto); Ok(SpecifiedValue::Explicit(ExplicitSize { width: width, diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-332.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-332.htm.ini index ad61ca4f8dd..c865f984df4 100644 --- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-332.htm.ini +++ b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-332.htm.ini @@ -12,12 +12,6 @@ [background_specified_repeat] expected: FAIL - [background_specified_attachment] - expected: FAIL - - [background_specified_origin] - expected: FAIL - [background_specified_color] expected: FAIL