Properly parse background-size in background longhand (fixes #15199)

This commit is contained in:
Anthony Ramine 2017-04-18 14:10:16 +02:00
parent 7f825d2119
commit efdc67d5a1
2 changed files with 3 additions and 11 deletions

View file

@ -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,