web-platform-tests / interop

web-platform-tests Interop project
https://wpt.fyi/interop
278 stars 28 forks source link

Rewrite property-cascade.html with getComputedStyle() #588

Closed fred-wang closed 10 months ago

fred-wang commented 10 months ago

Test List

https://wpt.fyi/results/css/css-properties-values-api/property-cascade.html

Rationale

The following tests from css-properties-values-api rely on the computedStyleMap() API from CSS Typed OM Level 1, which is being proposed for interop 2024 in #490:

css/css-properties-values-api/typedom.html
css/css-properties-values-api/at-property-typedom.html
css/css-properties-values-api/property-cascade.html

The two first are really testing the Typed OM spec with registered properties and are not labelled for interop 2023, so that's fine. However, the last one is included in interop 2023 and fails in Firefox, (which does not implement the computedStyleMap() API yet):

https://wpt.fyi/results/css/css-properties-values-api?q=label%3Ainterop-2023-property

Checking property-cascade.html in more details, computedStyleMap() is really only used to get the computed value of sRGB colors, which have the same used and resolved values. So getComputedStyle() can just be used instead.

(After doing that, WebKit and Chrome still pass the tests, while Firefox Nightly really fails because of it violates the actual assertion being tested)

nt1m commented 10 months ago

The change looks straightforward and uncontroversial to me.

@lilles @andruud Can you review this for Chromium?

fred-wang commented 10 months ago

cc @emilio

lilles commented 10 months ago

Changing https://wpt.fyi/results/css/css-properties-values-api/property-cascade.html to use getComputedStyle for color lgtm.

emilio commented 10 months ago

Yeah sounds good to me fwiw. Thanks Fred!