Auto merge of #15340 - upsuper:border-image-width, r=Wafflespeanut

Reject negative value for border-image-width

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15340)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-02 01:10:21 -08:00 committed by GitHub
commit 8aa23b46db

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));
} }