LibWeb/CSS: Allow setting any property to CSS-wide keywords in typed OM

A minor thing I missed before. Gets us 4 WPT passes per property that's
tested, which is quite a lot.
This commit is contained in:
Sam Atkins 2025-10-03 11:40:03 +01:00 committed by Andreas Kling
parent b2d55e4caa
commit 3644e75de1
9 changed files with 66 additions and 64 deletions

View File

@ -78,6 +78,8 @@ WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> CSSKeywordValue::create_an_
// identifier.
// If case-folding rules are in effect normally for that <ident> (such as Auto matching the keyword auto
// specified in the grammar for width), they apply to this comparison as well.
if (is_css_wide_keyword(m_value))
return true;
if (property.is_custom_property()) {
// FIXME: If this is a registered custom property, check if that allows the keyword.
return true;

View File

@ -2,5 +2,5 @@ Harness status: OK
Found 1 tests
1 Fail
Fail Declared styleMap objects accept 'inherit' as a value
1 Pass
Pass Declared styleMap objects accept 'inherit' as a value

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 37 tests
31 Pass
6 Fail
Fail Can set 'color' to CSS-wide keywords: initial
Fail Can set 'color' to CSS-wide keywords: inherit
Fail Can set 'color' to CSS-wide keywords: unset
Fail Can set 'color' to CSS-wide keywords: revert
35 Pass
2 Fail
Pass Can set 'color' to CSS-wide keywords: initial
Pass Can set 'color' to CSS-wide keywords: inherit
Pass Can set 'color' to CSS-wide keywords: unset
Pass Can set 'color' to CSS-wide keywords: revert
Fail Can set 'color' to var() references: var(--A)
Fail Can set 'color' to the 'currentcolor' keyword: currentcolor
Pass Setting 'color' to a length: 0px throws TypeError

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 69 tests
61 Pass
8 Fail
Fail Can set 'cursor' to CSS-wide keywords: initial
Fail Can set 'cursor' to CSS-wide keywords: inherit
Fail Can set 'cursor' to CSS-wide keywords: unset
Fail Can set 'cursor' to CSS-wide keywords: revert
65 Pass
4 Fail
Pass Can set 'cursor' to CSS-wide keywords: initial
Pass Can set 'cursor' to CSS-wide keywords: inherit
Pass Can set 'cursor' to CSS-wide keywords: unset
Pass Can set 'cursor' to CSS-wide keywords: revert
Fail Can set 'cursor' to var() references: var(--A)
Pass Can set 'cursor' to the 'auto' keyword: auto
Pass Can set 'cursor' to the 'default' keyword: default

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 56 tests
51 Pass
5 Fail
Fail Can set 'display' to CSS-wide keywords: initial
Fail Can set 'display' to CSS-wide keywords: inherit
Fail Can set 'display' to CSS-wide keywords: unset
Fail Can set 'display' to CSS-wide keywords: revert
55 Pass
1 Fail
Pass Can set 'display' to CSS-wide keywords: initial
Pass Can set 'display' to CSS-wide keywords: inherit
Pass Can set 'display' to CSS-wide keywords: unset
Pass Can set 'display' to CSS-wide keywords: revert
Fail Can set 'display' to var() references: var(--A)
Pass Can set 'display' to the 'none' keyword: none
Pass Can set 'display' to the 'block' keyword: block

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 32 tests
22 Pass
10 Fail
Fail Can set 'line-height' to CSS-wide keywords: initial
Fail Can set 'line-height' to CSS-wide keywords: inherit
Fail Can set 'line-height' to CSS-wide keywords: unset
Fail Can set 'line-height' to CSS-wide keywords: revert
26 Pass
6 Fail
Pass Can set 'line-height' to CSS-wide keywords: initial
Pass Can set 'line-height' to CSS-wide keywords: inherit
Pass Can set 'line-height' to CSS-wide keywords: unset
Pass Can set 'line-height' to CSS-wide keywords: revert
Fail Can set 'line-height' to var() references: var(--A)
Pass Can set 'line-height' to the 'normal' keyword: normal
Pass Can set 'line-height' to a length: 0px

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 124 tests
92 Pass
32 Fail
Fail Can set 'padding-top' to CSS-wide keywords: initial
Fail Can set 'padding-top' to CSS-wide keywords: inherit
Fail Can set 'padding-top' to CSS-wide keywords: unset
Fail Can set 'padding-top' to CSS-wide keywords: revert
108 Pass
16 Fail
Pass Can set 'padding-top' to CSS-wide keywords: initial
Pass Can set 'padding-top' to CSS-wide keywords: inherit
Pass Can set 'padding-top' to CSS-wide keywords: unset
Pass Can set 'padding-top' to CSS-wide keywords: revert
Fail Can set 'padding-top' to var() references: var(--A)
Pass Can set 'padding-top' to a percent: 0%
Fail Can set 'padding-top' to a percent: -3.14%
@ -35,10 +35,10 @@ Pass Setting 'padding-top' to a number: calc(2 + 3) throws TypeError
Pass Setting 'padding-top' to a transform: translate(50%, 50%) throws TypeError
Pass Setting 'padding-top' to a transform: perspective(10em) throws TypeError
Pass Setting 'padding-top' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
Fail Can set 'padding-left' to CSS-wide keywords: initial
Fail Can set 'padding-left' to CSS-wide keywords: inherit
Fail Can set 'padding-left' to CSS-wide keywords: unset
Fail Can set 'padding-left' to CSS-wide keywords: revert
Pass Can set 'padding-left' to CSS-wide keywords: initial
Pass Can set 'padding-left' to CSS-wide keywords: inherit
Pass Can set 'padding-left' to CSS-wide keywords: unset
Pass Can set 'padding-left' to CSS-wide keywords: revert
Fail Can set 'padding-left' to var() references: var(--A)
Pass Can set 'padding-left' to a percent: 0%
Fail Can set 'padding-left' to a percent: -3.14%
@ -66,10 +66,10 @@ Pass Setting 'padding-left' to a number: calc(2 + 3) throws TypeError
Pass Setting 'padding-left' to a transform: translate(50%, 50%) throws TypeError
Pass Setting 'padding-left' to a transform: perspective(10em) throws TypeError
Pass Setting 'padding-left' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
Fail Can set 'padding-right' to CSS-wide keywords: initial
Fail Can set 'padding-right' to CSS-wide keywords: inherit
Fail Can set 'padding-right' to CSS-wide keywords: unset
Fail Can set 'padding-right' to CSS-wide keywords: revert
Pass Can set 'padding-right' to CSS-wide keywords: initial
Pass Can set 'padding-right' to CSS-wide keywords: inherit
Pass Can set 'padding-right' to CSS-wide keywords: unset
Pass Can set 'padding-right' to CSS-wide keywords: revert
Fail Can set 'padding-right' to var() references: var(--A)
Pass Can set 'padding-right' to a percent: 0%
Fail Can set 'padding-right' to a percent: -3.14%
@ -97,10 +97,10 @@ Pass Setting 'padding-right' to a number: calc(2 + 3) throws TypeError
Pass Setting 'padding-right' to a transform: translate(50%, 50%) throws TypeError
Pass Setting 'padding-right' to a transform: perspective(10em) throws TypeError
Pass Setting 'padding-right' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
Fail Can set 'padding-bottom' to CSS-wide keywords: initial
Fail Can set 'padding-bottom' to CSS-wide keywords: inherit
Fail Can set 'padding-bottom' to CSS-wide keywords: unset
Fail Can set 'padding-bottom' to CSS-wide keywords: revert
Pass Can set 'padding-bottom' to CSS-wide keywords: initial
Pass Can set 'padding-bottom' to CSS-wide keywords: inherit
Pass Can set 'padding-bottom' to CSS-wide keywords: unset
Pass Can set 'padding-bottom' to CSS-wide keywords: revert
Fail Can set 'padding-bottom' to var() references: var(--A)
Pass Can set 'padding-bottom' to a percent: 0%
Fail Can set 'padding-bottom' to a percent: -3.14%

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 33 tests
23 Pass
10 Fail
Fail Can set 'transform' to CSS-wide keywords: initial
Fail Can set 'transform' to CSS-wide keywords: inherit
Fail Can set 'transform' to CSS-wide keywords: unset
Fail Can set 'transform' to CSS-wide keywords: revert
27 Pass
6 Fail
Pass Can set 'transform' to CSS-wide keywords: initial
Pass Can set 'transform' to CSS-wide keywords: inherit
Pass Can set 'transform' to CSS-wide keywords: unset
Pass Can set 'transform' to CSS-wide keywords: revert
Fail Can set 'transform' to var() references: var(--A)
Fail Can set 'transform' to the 'none' keyword: none
Fail Can set 'transform' to a transform: translate(50%, 50%)

View File

@ -2,12 +2,12 @@ Harness status: OK
Found 95 tests
71 Pass
24 Fail
Fail Can set 'width' to CSS-wide keywords: initial
Fail Can set 'width' to CSS-wide keywords: inherit
Fail Can set 'width' to CSS-wide keywords: unset
Fail Can set 'width' to CSS-wide keywords: revert
83 Pass
12 Fail
Pass Can set 'width' to CSS-wide keywords: initial
Pass Can set 'width' to CSS-wide keywords: inherit
Pass Can set 'width' to CSS-wide keywords: unset
Pass Can set 'width' to CSS-wide keywords: revert
Fail Can set 'width' to var() references: var(--A)
Pass Can set 'width' to the 'auto' keyword: auto
Pass Can set 'width' to a percent: 0%
@ -36,10 +36,10 @@ Pass Setting 'width' to a number: calc(2 + 3) throws TypeError
Pass Setting 'width' to a transform: translate(50%, 50%) throws TypeError
Pass Setting 'width' to a transform: perspective(10em) throws TypeError
Pass Setting 'width' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
Fail Can set 'min-width' to CSS-wide keywords: initial
Fail Can set 'min-width' to CSS-wide keywords: inherit
Fail Can set 'min-width' to CSS-wide keywords: unset
Fail Can set 'min-width' to CSS-wide keywords: revert
Pass Can set 'min-width' to CSS-wide keywords: initial
Pass Can set 'min-width' to CSS-wide keywords: inherit
Pass Can set 'min-width' to CSS-wide keywords: unset
Pass Can set 'min-width' to CSS-wide keywords: revert
Fail Can set 'min-width' to var() references: var(--A)
Pass Can set 'min-width' to a percent: 0%
Fail Can set 'min-width' to a percent: -3.14%
@ -67,10 +67,10 @@ Pass Setting 'min-width' to a number: calc(2 + 3) throws TypeError
Pass Setting 'min-width' to a transform: translate(50%, 50%) throws TypeError
Pass Setting 'min-width' to a transform: perspective(10em) throws TypeError
Pass Setting 'min-width' to a transform: translate3d(0px, 1px, 2px) translate(0px, 1px) rotate3d(1, 2, 3, 45deg) rotate(45deg) scale3d(1, 2, 3) scale(1, 2) skew(1deg, 1deg) skewX(1deg) skewY(45deg) perspective(1px) matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) matrix(1, 2, 3, 4, 5, 6) throws TypeError
Fail Can set 'max-width' to CSS-wide keywords: initial
Fail Can set 'max-width' to CSS-wide keywords: inherit
Fail Can set 'max-width' to CSS-wide keywords: unset
Fail Can set 'max-width' to CSS-wide keywords: revert
Pass Can set 'max-width' to CSS-wide keywords: initial
Pass Can set 'max-width' to CSS-wide keywords: inherit
Pass Can set 'max-width' to CSS-wide keywords: unset
Pass Can set 'max-width' to CSS-wide keywords: revert
Fail Can set 'max-width' to var() references: var(--A)
Pass Can set 'max-width' to the 'none' keyword: none
Pass Can set 'max-width' to a percent: 0%