Closed Bug 1841245 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 40828 - Make calc(NaN) behave as calc(0) when it's top level calculation

Categories

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

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Daniil Sakhapov <sakhapov@chromium.org> wrote:

Make calc(NaN) behave as calc(0) when it's top level calculation

https://www.w3.org/TR/css-values-4/#top-level-calculation

calc-interpolation.html test changes due to the CSS Values 4 spec:

Dividing zero by zero, dividing ±∞ by ±∞, multiplying 0 by ±∞,
adding +∞ to −∞ (or the equivalent subtractions) produces NaN.

Interpolation of math functions, with each other or with numeric values
and other numeric-valued functions, is defined as
Vresult = calc((1 - p) * Va + p * Vb).

This means that the interpolation at p=0 is: calc((1 - 0) * 0px + 0 * (infinity * 1px), which simplifies to calc(0px + NaN), which should clamp to 0px.

Fixed: 1334599

Change-Id: I09f6a2fa9b60f17c5fc6562192f53918e365fe55

Reviewed-on: https://chromium-review.googlesource.com/4651881
WPT-Export-Revision: d25f97424514f918b9b4a4bd7fb98a7d33c69707

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 164 subtests

Status Summary

Firefox

OK : 1
PASS: 140

Chrome

OK : 1
PASS: 130
FAIL: 10

Safari

OK : 1
PASS: 116
FAIL: 24

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/430b20cb9ccd [wpt PR 40828] - Make calc(NaN) behave as calc(0) when it's top level calculation, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.