Closed Bug 1834164 Opened 1 year ago Closed 1 year ago

Serialize NaN and infinity numbers

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox115 --- wontfix
firefox116 --- fixed

People

(Reporter: canadahonk, Assigned: canadahonk)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

<number> values like NaN and infinity (and -infinity) should be serialized properly as per spec, see WPT tests for examples. opacity: number and transform: scale(number) can be used as number examples. There are no WPT tests just for this, they should be added (something like calc-infinity-nan-serialize-number.html, see similar existing tests).

Some current existing WPT tests show this:

Summary: Serialize NaN and infinity numbers/integers → Serialize NaN and infinity numbers

Changed scope of this bug to just numbers as our existing NaN/inf util funcs are for floats and integers are more complex and require more investigation into expected/spec behavior with NaN/inf.

Added NaN/inf serialization of <number> and changed calc() code to not
remove NaN/infinity in code using it.

This change is unfortunately imperfect as some things using <number>
still refuse to serialize NaN/infinity for some reason (scale()?), but
this bug/patch is just for <number> so leaving that out of scope for this.

Also added new WPT test file for number NaN/inf serialization based
on existing serialization tests (all pass already!).

5 other WPT subtests now newly pass.

Assignee: nobody → oj
Status: NEW → ASSIGNED
Pushed by oj@oojmed.com: https://hg.mozilla.org/integration/autoland/rev/ff7a5040b749 Serialize NaN and infinity numbers r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/40139 for changes under testing/web-platform/tests

Backed out for causing build bustages

Backout link

Push with failures

Failure log

Flags: needinfo?(oj)

Apologies, fixed in patch update.

Flags: needinfo?(oj)
Upstream PR was closed without merging
Pushed by oj@oojmed.com: https://hg.mozilla.org/integration/autoland/rev/4a8d978dd79c Serialize NaN and infinity numbers r=emilio
Upstream PR was closed without merging
Attachment #9335123 - Attachment description: Bug 1834164 - Serialize NaN and infinity numbers → WIP: Bug 1834164 - Serialize NaN and infinity numbers

Changed patch to WIP as this broke more (reftests) than first seemed due to some things not expecting NaN/inf values.

Flags: needinfo?(oj)
Attachment #9335123 - Attachment description: WIP: Bug 1834164 - Serialize NaN and infinity numbers → Bug 1834164 - Serialize NaN and infinity numbers

(In reply to CanadaHonk [:canadahonk] from comment #11)

Changed patch to WIP as this broke more (reftests) than first seemed due to some things not expecting NaN/inf values.

Looks like it changed back from WIP. :) Is this good to re-land?

Flags: needinfo?(oj)

Sorry for delay, was refraining a bit due to the "troubles" from this. Landing again :)

Flags: needinfo?(oj)
Pushed by oj@oojmed.com: https://hg.mozilla.org/integration/autoland/rev/1016ade4b638 Serialize NaN and infinity numbers r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:canadahonk, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox115 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(oj)

Not worth uplifting; this can ride the trains as normal.

Flags: needinfo?(oj)

(In reply to CanadaHonk [:canadahonk] from comment #0)

Some current existing WPT tests show this:

Looks like these are now fixed. http://wpt.live/css/css-values/exp-log-serialize.html now only shows 2 failures, the very last 2, which fail in the same way among all browsers I think.

I don't think these ones ended up being fixed here. We pass 52/68 test in this WPT (failing 16), both before and after this patch. It looks like bug 1834361 covers this part --> adding that as a dependency, since it seems it'll build on top of the work here.

Blocks: 1834361
Severity: -- → S3

(Thanks for the fix, BTW! :) )

No longer blocks: 1856158
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: