[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•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
These are implemented already behind layout.css.trig.enabled
. When I implemented them, the missing bits were test coverage.
Comment 2•1 year 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•1 year ago
|
Comment 4•1 year 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•1 year 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•1 year ago
|
Assignee | ||
Comment 6•1 year 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•1 year ago
|
||
Let's enable on nightly for now, we can enable everywhere after the soft freeze.
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/03b2061c924b Implement atan2(), and enable calc() trigonometric functions by default on nightly. r=boris https://hg.mozilla.org/integration/autoland/rev/bcf5fcb47b4a Fix a couple css-values tests while at it. r=boris
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Comment 10•1 year ago
|
||
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/1d850765046a Annotate a test that's failing on macOS.
Comment 11•1 year 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•1 year ago
|
Comment 12•1 year ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/02eccb000404 Implement atan2(), and enable calc() trigonometric functions by default on nightly. r=boris https://hg.mozilla.org/integration/autoland/rev/fc449cf7d476 Fix a couple css-values tests while at it. r=boris
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 13•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/02eccb000404
https://hg.mozilla.org/mozilla-central/rev/fc449cf7d476
Comment 14•1 year ago
|
||
I'm tracking documentation tasks for these changes in the following parent ticket on GitHub: https://github.com/mdn/content/issues/19832
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36038 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Updated•11 months ago
|
Description
•