[css-values-4] Clean up trig function definitions #3761
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #2331 and commit b8935e7
The only normative change (from Tab's commit) is that
atan2()
is changed to support values with dimensions (so long as both dimensions are the same).
I don't see any implementation reason not to allow it;
they type checking rules are the same as
hypot
(except that the types cancel out, so don't affect the final type of the function).
Most other corrections should be obvious in the diff.
I changed the note about atan2 because it used terminology
based on a y-axis-up coordinate system
and CSS/SVG uses a y-axis-down system.
I changed the notes about simplifying at computed value time
to refer to calculations instead of math functions,
because some complex nested functions cannot be simplified early.
(E.g.,
hypot(100%, 5em)
can't be simplified until percentages can be turned into lengths.)Edits still required:
The Syntax and Serialization sections should probably include entries for the new functions. But I wasn't sure how that should look.
PS, Thanks for the main commit @tabatkins! I'd said I'd give it a go, but who knows when I would have got to it.
(And I probably would have just linked to ECMAScript for all the stuff to do with infinities and NaN.)