[css-values-4] Implement trigonometric functions and constants
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: seokho, Assigned: emilio)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Expected results:
According to the new CSS specification [1], CSS should support trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), atan2().
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
These are implemented already behind layout.css.trig.enabled
. When I implemented them, the missing bits were test coverage.
Comment 2•2 years ago
|
||
Cool! Sounds like this is basically shippable. Is there already a bug for adding those tests? And should there be a separate one for shipping them or should this bug be used for that?
Sebastian
Updated•2 years ago
|
Comment 4•2 years ago
|
||
For reference, the constants that are obviously also already implemented behind the pref mentioned in comment 1 are defined at https://drafts.csswg.org/css-values-4/#calc-constants.
Sebastian
Assignee | ||
Comment 5•2 years ago
|
||
We now have test coverage, so let's do this.
The remaining failures are just about infinity/nan, which is a
completely different feature.
Updated•2 years ago
|
Assignee | ||
Comment 6•2 years ago
|
||
While I was looking at this, let's fix some incorrect tests.
The changes to expect simplification come from
https://drafts.csswg.org/css-values-4/#calc-simplification:
Internal representations of math functions are eagerly simplified to
the extent possible, using standard algebraic simplifications
(distributing multiplication over sums, combining similar units,
etc.)
The changes to tests that expected 0% / 0px / etc are just wrong because
the test harness treat 0 as the "default" used value, and fails. These
fail in all browsers.
Depends on D154831
Assignee | ||
Comment 7•2 years ago
|
||
Let's enable on nightly for now, we can enable everywhere after the soft freeze.
Comment 10•2 years ago
|
||
Comment 11•2 years ago
•
|
||
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
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 13•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/02eccb000404
https://hg.mozilla.org/mozilla-central/rev/fc449cf7d476
Comment 14•2 years ago
|
||
I'm tracking documentation tasks for these changes in the following parent ticket on GitHub: https://github.com/mdn/content/issues/19832
Updated•2 years ago
|
Description
•