Closed Bug 2025848 Opened 7 months ago Closed 7 months ago

Improve matching of Color values in container style queries

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 external file)

When a container style query uses a custom property with a <color> value, it should be able to match the color even if it was specified in a different color space (see https://github.com/w3c/csswg-drafts/issues/13157). Currently, we fail to match across different color spaces, or even colors specified in legacy vs modern sRGB syntax.

Once details in the spec issue are resolved, we should ensure our behavior matches what is expected.

Tentative behavior, pending resolution of https://github.com/w3c/csswg-drafts/issues/13157;
once the WG decides exactly what to do there we can refine this as necessary.

Adding a simple test based on the codepen example in the issue. (Further tests should be
created once the details of the issue are resolved.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #9557479 - Attachment description: Bug 2025848 - Convert colors to Oklch color-space for comparison, and allow a small epsilon difference when evaluating container style queries. → Bug 2025848 - When comparing ComputedValueComponent values for equality, convert absolute colors to Oklab and allow a small epsilon difference. r=#style

Not sure if this is the same bug or not, but https://codepen.io/una/pen/xbEpexq/0828407d5f6372aac5da32d6c61ecc1d is also at the intersection of <color> and style queries.

Firefox is currently not picking up the --cc getting computed to either black or white (the result of contrast-color())

Attachment #9557479 - Attachment description: Bug 2025848 - When comparing ComputedValueComponent values for equality, convert absolute colors to Oklab and allow a small epsilon difference. r=#style → Bug 2025848 - When comparing AbsoluteColor values for equality, convert both colors to Oklab and allow a small epsilon difference. r=#style
Pushed by jkew@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cd22e47cb340 https://hg.mozilla.org/integration/autoland/rev/b96485698f5e When comparing AbsoluteColor values for equality, convert both colors to Oklab and allow a small epsilon difference. r=firefox-style-system-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/58854 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Regressions: 2030624
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: