Closed Bug 1765037 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 33662 - EvaluateOperator() should return NaN if operands has NaN value

Categories

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

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Seokho Song <seokho@chromium.org> wrote:

EvaluateOperator() should return NaN if operands has NaN value

According to spec [1], 'Any operation with at least one NaN argument produces NaN'

However, the compare expression results are false so possibly return the number for std::max and std::min.

e.g. ( "( param1 \< param2)? param1 : param2" ) - if param1 is NaN, it will always return param2.

Therefore, check NaN existence in operands before the actual operation is consumed.

[1] https://drafts.csswg.org/css-values/#calc-type-checking

Bug: 1313012
Change-Id: I28e977adf233ffca99aa8d7d61cd95a509805f15
Reviewed-on: https://chromium-review.googlesource.com/3586615
WPT-Export-Revision: 04b5c25373b619e1ac36cc97515d7bf0d06a3d62

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/464d0d8e7af3
[wpt PR 33662] - EvaluateOperator() should return NaN if operands has NaN value, a=testonly
https://hg.mozilla.org/integration/autoland/rev/e676adb01d75
[wpt PR 33662] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.