[csswg-drafts] Pull Request: [css-values-4] Clean up trig function definitions

AmeliaBR has just submitted a new pull request for https://github.com/w3c/csswg-drafts:

== [css-values-4] Clean up trig function definitions ==
Related to #2331 and commit b8935e7df14ed544c51a991cf10f15bf077eb603

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](https://drafts.csswg.org/css-values/#calc-syntax) and [Serialization](https://drafts.csswg.org/css-values/#calc-serialize) 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.)


See https://github.com/w3c/csswg-drafts/pull/3761

Received on Tuesday, 26 March 2019 01:40:10 UTC