From 91cc30046b015888080d7f1fdfc09a2824977324 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 24 Apr 2017 12:57:12 +0200 Subject: [PATCH] Implement the unitless length quirk for border-width --- .../style/properties/shorthand/border.mako.rs | 7 ++++--- .../quirks-mode/unitless-length.html.ini | 21 ------------------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/components/style/properties/shorthand/border.mako.rs b/components/style/properties/shorthand/border.mako.rs index 00fc89b0cec..223e5069d59 100644 --- a/components/style/properties/shorthand/border.mako.rs +++ b/components/style/properties/shorthand/border.mako.rs @@ -17,11 +17,12 @@ ${helpers.four_sides_shorthand("border-style", "border-%s-style", for side in PHYSICAL_SIDES)}" spec="https://drafts.csswg.org/css-backgrounds/#border-width"> use super::parse_four_sides; - use parser::Parse; - use values::specified; + use values::specified::{AllowQuirks, BorderWidth}; pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result { - let (top, right, bottom, left) = try!(parse_four_sides(input, |i| specified::BorderWidth::parse(context, i))); + let (top, right, bottom, left) = try!(parse_four_sides(input, |i| { + BorderWidth::parse_quirky(context, i, AllowQuirks::Yes) + })); Ok(Longhands { % for side in PHYSICAL_SIDES: ${to_rust_ident('border-%s-width' % side)}: ${side}, diff --git a/tests/wpt/metadata/quirks-mode/unitless-length.html.ini b/tests/wpt/metadata/quirks-mode/unitless-length.html.ini index 84929e65d87..aec7eace770 100644 --- a/tests/wpt/metadata/quirks-mode/unitless-length.html.ini +++ b/tests/wpt/metadata/quirks-mode/unitless-length.html.ini @@ -1,8 +1,5 @@ [unitless-length.html] type: testharness - [border-width: 1 (quirks)] - expected: FAIL - [bottom: 1 (quirks)] expected: FAIL @@ -87,9 +84,6 @@ [word-spacing: 1 (quirks)] expected: FAIL - [border-width: +1 (quirks)] - expected: FAIL - [bottom: +1 (quirks)] expected: FAIL @@ -225,9 +219,6 @@ [word-spacing: -1 (quirks)] expected: FAIL - [border-width: 1.5 (quirks)] - expected: FAIL - [bottom: 1.5 (quirks)] expected: FAIL @@ -312,9 +303,6 @@ [word-spacing: 1.5 (quirks)] expected: FAIL - [border-width: +1.5 (quirks)] - expected: FAIL - [bottom: +1.5 (quirks)] expected: FAIL @@ -1188,27 +1176,18 @@ [top: calc(2 * 2px) (standards)] expected: FAIL - [border-width: 1px 2 (quirks)] - expected: FAIL - [margin: 1px 2 (quirks)] expected: FAIL [padding: 1px 2 (quirks)] expected: FAIL - [border-width: 1 2px (quirks)] - expected: FAIL - [margin: 1 2px (quirks)] expected: FAIL [padding: 1 2px (quirks)] expected: FAIL - [border-width: 1 +2 (quirks)] - expected: FAIL - [margin: 1 +2 (quirks)] expected: FAIL