servo: Merge #15340 - Reject negative value for border-image-width (from upsuper:border-image-width); r=Wafflespeanut
authorXidorn Quan <me@upsuper.org>
Thu, 02 Feb 2017 01:10:21 -0800
changeset 340774 55d241ca39b516c2541bc5eba59f6ea94bf133c5
parent 340773 00cf99820fe7d5de832addc52b41b63b737a4157
child 340775 de2c47d37ae9b3e7b5faa769a852dc604b92128b
push id86548
push userkwierso@gmail.com
push dateSat, 04 Feb 2017 01:35:21 +0000
treeherdermozilla-inbound@e7b96d015d03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWafflespeanut
servo: Merge #15340 - Reject negative value for border-image-width (from upsuper:border-image-width); r=Wafflespeanut Source-Repo: https://github.com/servo/servo Source-Revision: 8aa23b46db300210b67c16190c794bc9ee216f3f
servo/components/style/properties/longhand/border.mako.rs
--- a/servo/components/style/properties/longhand/border.mako.rs
+++ b/servo/components/style/properties/longhand/border.mako.rs
@@ -516,22 +516,22 @@
             SpecifiedValue(vec![ToComputedValue::from_computed_value(&computed.0),
                                 ToComputedValue::from_computed_value(&computed.1),
                                 ToComputedValue::from_computed_value(&computed.2),
                                 ToComputedValue::from_computed_value(&computed.3)])
         }
     }
 
     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() {
                 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));
             }
 
             let num = try!(Number::parse_non_negative(input));
             Ok(SingleSpecifiedValue::Number(num))
         }
     }