Closed Bug 1837029 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 40397 - Serialize and compute non-finite color channels

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 40397 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/40397
Details from upstream follow.

Aaron Krajeski <aaronhk@chromium.org> wrote:

Serialize and compute non-finite color channels

http://github.com/w3c/csswg-drafts/issues/8629
http://github.com/web-platform-tests/wpt/pull/39137/files
http://wpt.fyi/results/css/css-color/parsing

Color parsing is a part of Interop 2023. Handling non-finite inputs
to color channels is a bit tricky. At parse time calc(NaN) and
calc(infinity) (and their equivalents) are valid CSS numerical inputs,
and should get re-serialized as such so that they round-trip.

Per-spec, calc(NaN) should become 0 at computed value time.
calc(infinity) should remain calc(infinity), except in cases where it represents a clamped color channel, such as lightness or chroma.
Unfortunately, blink had previously made no distinction between parsed
and computed colors, hence the creation of
blink::Color::ResolveNonFiniteValues (called from
TextLinkColors::ColorFromCSSValue) in this CL.

Before CSS Color 4, color functions were less exposed to things like
calc functions, so this problem went unnoticed.

Bug: 1428845
Change-Id: Id385405008a33759c67b8b9ffb62f100856f590d

Reviewed-on: https://chromium-review.googlesource.com/4575281
WPT-Export-Revision: ed38f1250390ba6f23e00db484d4340a38b7d185

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Test result changes from PR not available.
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fbc6a3ccd3af [wpt PR 40397] - Serialize and compute non-finite color channels, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.