style: Parse '0' as a number for border-image-width.

As per CSS Values & Units:

"However, if a 0 could be parsed as either a <number> or a <length> in a
property (such as line-height), it must parse as a <number>."

(https://drafts.csswg.org/css-values-4/#lengths)

Differential Revision: https://phabricator.services.mozilla.com/D46723
This commit is contained in:
Brian Birtles 2019-09-23 02:07:16 +00:00 committed by Emilio Cobos Álvarez
parent a0e2aeb51c
commit 877c6ac821
2 changed files with 6 additions and 20 deletions

View file

@ -180,24 +180,6 @@ impl BorderImageSideWidth {
}
}
impl Parse for BorderImageSideWidth {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
return Ok(GenericBorderImageSideWidth::Auto);
}
if let Ok(len) = input.try(|i| NonNegativeLengthPercentage::parse(context, i)) {
return Ok(GenericBorderImageSideWidth::LengthPercentage(len));
}
let num = NonNegativeNumber::parse(context, input)?;
Ok(GenericBorderImageSideWidth::Number(num))
}
}
impl Parse for BorderImageSlice {
fn parse<'i, 't>(
context: &ParserContext,