From 59a7819aa9849828f9c59e5a4e11be45a7d1463e Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 25 Apr 2017 19:39:34 +0200 Subject: [PATCH] Implement the unitless length quirk for vertical-align --- .../style/properties/longhand/box.mako.rs | 3 ++- .../quirks-mode/unitless-length.html.ini | 18 ------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 2806a04e8031..c2ee7ab1f89b 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -264,6 +264,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed", use std::fmt; use style_traits::ToCss; use values::HasViewportPercentage; + use values::specified::AllowQuirks; <% vertical_align = data.longhands_by_name["vertical-align"] %> <% vertical_align.keyword = Keyword("vertical-align", @@ -306,7 +307,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed", /// baseline | sub | super | top | text-top | middle | bottom | text-bottom /// | | pub fn parse(context: &ParserContext, input: &mut Parser) -> Result { - input.try(|i| specified::LengthOrPercentage::parse(context, i)) + input.try(|i| specified::LengthOrPercentage::parse_quirky(context, i, AllowQuirks::Yes)) .map(SpecifiedValue::LengthOrPercentage) .or_else(|_| { match_ignore_ascii_case! { &try!(input.expect_ident()), diff --git a/tests/wpt/metadata/quirks-mode/unitless-length.html.ini b/tests/wpt/metadata/quirks-mode/unitless-length.html.ini index 60709b5ab993..701b162c251a 100644 --- a/tests/wpt/metadata/quirks-mode/unitless-length.html.ini +++ b/tests/wpt/metadata/quirks-mode/unitless-length.html.ini @@ -24,9 +24,6 @@ expected: if os == "mac": FAIL - [vertical-align: 1 (quirks)] - expected: FAIL - [word-spacing: 1 (quirks)] expected: FAIL @@ -54,9 +51,6 @@ expected: if os == "mac": FAIL - [vertical-align: +1 (quirks)] - expected: FAIL - [word-spacing: +1 (quirks)] expected: FAIL @@ -84,9 +78,6 @@ expected: if os == "mac": FAIL - [vertical-align: -1 (quirks)] - expected: FAIL - [word-spacing: -1 (quirks)] expected: FAIL @@ -114,9 +105,6 @@ expected: if os == "mac": FAIL - [vertical-align: 1.5 (quirks)] - expected: FAIL - [word-spacing: 1.5 (quirks)] expected: FAIL @@ -144,9 +132,6 @@ expected: if os == "mac": FAIL - [vertical-align: +1.5 (quirks)] - expected: FAIL - [word-spacing: +1.5 (quirks)] expected: FAIL @@ -174,9 +159,6 @@ expected: if os == "mac": FAIL - [vertical-align: -1.5 (quirks)] - expected: FAIL - [word-spacing: -1.5 (quirks)] expected: FAIL