Reject negative value for border-image-width

This commit is contained in:
Xidorn Quan 2017-02-02 17:09:10 +11:00
parent 8b9dc9392b
commit bf52419716

View file

@ -521,12 +521,12 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
} }
impl Parse for SingleSpecifiedValue { impl Parse for SingleSpecifiedValue {
fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> { fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
if input.try(|input| input.expect_ident_matching("auto")).is_ok() { if input.try(|input| input.expect_ident_matching("auto")).is_ok() {
return Ok(SingleSpecifiedValue::Auto); return Ok(SingleSpecifiedValue::Auto);
} }
if let Ok(len) = input.try(|input| LengthOrPercentage::parse(context, input)) { if let Ok(len) = input.try(|input| LengthOrPercentage::parse_non_negative(input)) {
return Ok(SingleSpecifiedValue::LengthOrPercentage(len)); return Ok(SingleSpecifiedValue::LengthOrPercentage(len));
} }