Closed Bug 1682444 Opened 3 years ago Closed 2 years ago

Math function 'calc()' should allow infinity and NaN

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

Firefox 83
enhancement

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: seokho, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Expected results:

According to the new CSS specification [1], CSS calc() math function should allow infinity and NaN values by 'infinity', '-infinity', 'NaN' keywords or expressions that could be evaluated into infinity or NaN such as 'calc(1/0)'.

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

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: General → CSS Parsing and Computation
Product: Firefox → Core
Blocks: css-values-4
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Fix some tests to:

Not sure I caught all, but normalizing to 0 was already our existing
behavior. This feature needs more work before it can be enabled more
generally, so make it nightly-only, for now.

Also, it's unclear per spec what the serialization for infinity*1s or so
should be. Right now we serialize to <very-big-number>s, which seems
reasonable, but some tests (but not others!) expect different behavior.

I left those untouched for now.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bf0c0ff13cc1
Add basic support for nan / infinity in calc(). r=boris
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35502 for changes under testing/web-platform/tests
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/08ec785b9923
Remove some property_database.js tests which are now valid.
Regressions: 1785733
Backout by mlaza@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f4a6a73188de
Backed out 5 changesets (bug 1682444, bug 1774589) for causing wpt failures on acos-asin-atan-atan2-serialize.html. CLOSED TREE

Backed out 5 changesets (Bug 1682444, Bug 1774589) for causing wpt failures on acos-asin-atan-atan2-serialize.html.
Backout link
Push with failures --> 1st push <--> push with fix
Failure Log wpt6 1st push <--> wpt6 push with fix

Flags: needinfo?(emilio)
Backout by mlaza@mozilla.com:
https://hg.mozilla.org/mozilla-central/rev/f11d32415e9b
Backed out 5 changesets (bug 1682444, bug 1774589) for causing wpt failures on acos-asin-atan-atan2-serialize.html. CLOSED TREE
Attachment #9290272 - Attachment description: Bug 1682444 - Add basic support for nan / infinity in calc(). r=#style,#layout → Bug 1682444 - Add basic support for nan / infinity in calc(). r=boris
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a71f1814b2d7
Add basic support for nan / infinity in calc(). r=boris
Flags: needinfo?(emilio)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Upstream PR merged by moz-wptsync-bot

We are tracking the docs additions for this along with related CSS trig functions docs in https://github.com/mdn/content/issues/19832

Regressions: 1807966
Regressions: 1831410
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: