Skip to content

Commit

Permalink
Properly parse background-size in background longhand (fixes #15199)
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Apr 18, 2017
1 parent 56435db commit af1c026
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions components/style/properties/longhand/background.mako.rs
Expand Up @@ -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,
Expand Down

0 comments on commit af1c026

Please sign in to comment.