Always expect deg in CSS calc NaN unit tests#38825
Always expect deg in CSS calc NaN unit tests#38825CanadaHonk wants to merge 1 commit intoweb-platform-tests:masterfrom
Conversation
|
Think this is correct now, closing. |
|
Yes, these tests are testing serialization of specified values, not serialization of computed values, so the units should be preserved as specified. The canonicalization of units happens at value computation time. |
|
Sorry for the confusion, thanks for the clarification. Might add some dedicated new tests in a Gecko patch later as most (2/3) vendors don't do this yet. |
|
@dbaron what about the simplification of the calc? https://www.w3.org/TR/css-values-4/#simplify-a-calculation-tree |
|
From a very quick look at the spec, it looks like those steps are referenced both from parsing rules and computed value rules. In other words, they affect both specified values and computed values. I think this makes sense because, due to other simplifications, they can affect specified and computed values differently. For example, I think (based on executing the spec in my head, and just doing some bits from memory!) |
|
Right, math functions eagerly simplify/canonicalize to the extent possible, given the value stage they're at. So a unit in calc() is always turned into the canonical unit if possible. And for these tests in particular, Step 2 of the serialization algo is explicit about how to serialize infinite and NaN values - always produce a string that looks like |
|
I will probably leave this changes for Gecko patch (https://phabricator.services.mozilla.com/D171658) and for the bot to upstream if that sounds good. |
|
Okay, I'll leave merging to you. |
|
Closing in favor of completing in Gecko downstream. |
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see #38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1820407 gecko-commit: 64d14248fe9046e5cbc58931abf366b3e62d43da gecko-reviewers: emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see #38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1820407 gecko-commit: 64d14248fe9046e5cbc58931abf366b3e62d43da gecko-reviewers: emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see #38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1820407 gecko-commit: 64d14248fe9046e5cbc58931abf366b3e62d43da gecko-reviewers: emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1820407 gecko-commit: 64d14248fe9046e5cbc58931abf366b3e62d43da gecko-reviewers: emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see web-platform-tests/wpt#38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
According to the spec: https://www.w3.org/TR/css-values-3/#compat
But in the tests for NaN with units (L17-19), it is checked to be the same as the unit given, not the canonical unit (deg)? Safari would now pass, and Chrome would fail.
Solves #38821. This might be better as a downstream (Gecko) change, please let me know which would be best. (https://phabricator.services.mozilla.com/D171658)