Skip to content

Commit

Permalink
Implement the unitless length quirk for physical size properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Apr 27, 2017
1 parent 0e7308e commit 65f74ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
1 change: 1 addition & 0 deletions components/style/properties/longhand/position.mako.rs
Expand Up @@ -158,6 +158,7 @@ ${helpers.predefined_type("flex-basis",
"computed::LengthOrPercentageOrAuto::Auto",
"parse_non_negative",
spec=spec % size,
allow_quirks=not logical,
animation_value_type="ComputedValue", logical = logical)}
% if product == "gecko":
% for min_max in ["min", "max"]:
Expand Down
11 changes: 10 additions & 1 deletion components/style/values/specified/length.rs
Expand Up @@ -1360,7 +1360,16 @@ impl LengthOrPercentageOrAuto {
/// Parse a non-negative length, percentage, or auto.
#[inline]
pub fn parse_non_negative(context: &ParserContext, input: &mut Parser) -> Result<LengthOrPercentageOrAuto, ()> {
Self::parse_internal(context, input, AllowedLengthType::NonNegative, AllowQuirks::No)
Self::parse_non_negative_quirky(context, input, AllowQuirks::No)
}

/// Parse a non-negative length, percentage, or auto.
#[inline]
pub fn parse_non_negative_quirky(context: &ParserContext,
input: &mut Parser,
allow_quirks: AllowQuirks)
-> Result<Self, ()> {
Self::parse_internal(context, input, AllowedLengthType::NonNegative, allow_quirks)
}

/// Returns the `auto` value.
Expand Down
24 changes: 0 additions & 24 deletions tests/wpt/metadata/quirks-mode/unitless-length.html.ini
Expand Up @@ -12,9 +12,6 @@
expected:
if os == "mac": FAIL

[height: 1 (quirks)]
expected: FAIL

[letter-spacing: 1 (quirks)]
expected: FAIL

Expand Down Expand Up @@ -75,9 +72,6 @@
[vertical-align: 1 (quirks)]
expected: FAIL

[width: 1 (quirks)]
expected: FAIL

[word-spacing: 1 (quirks)]
expected: FAIL

Expand All @@ -93,9 +87,6 @@
expected:
if os == "mac": FAIL

[height: +1 (quirks)]
expected: FAIL

[letter-spacing: +1 (quirks)]
expected: FAIL

Expand Down Expand Up @@ -156,9 +147,6 @@
[vertical-align: +1 (quirks)]
expected: FAIL

[width: +1 (quirks)]
expected: FAIL

[word-spacing: +1 (quirks)]
expected: FAIL

Expand Down Expand Up @@ -225,9 +213,6 @@
expected:
if os == "mac": FAIL

[height: 1.5 (quirks)]
expected: FAIL

[letter-spacing: 1.5 (quirks)]
expected: FAIL

Expand Down Expand Up @@ -288,9 +273,6 @@
[vertical-align: 1.5 (quirks)]
expected: FAIL

[width: 1.5 (quirks)]
expected: FAIL

[word-spacing: 1.5 (quirks)]
expected: FAIL

Expand All @@ -306,9 +288,6 @@
expected:
if os == "mac": FAIL

[height: +1.5 (quirks)]
expected: FAIL

[letter-spacing: +1.5 (quirks)]
expected: FAIL

Expand Down Expand Up @@ -369,9 +348,6 @@
[vertical-align: +1.5 (quirks)]
expected: FAIL

[width: +1.5 (quirks)]
expected: FAIL

[word-spacing: +1.5 (quirks)]
expected: FAIL

Expand Down

0 comments on commit 65f74ea

Please sign in to comment.