Intent to ship: calc() trigonometric functions and constants

72 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Oct 28, 2022, 11:07:10 AM10/28/22
to dev-pl...@mozilla.org
Hi,

In bug 1787070 I plan to turn calc() trigonometric functions / constants
on everywhere. These are a nice extension to calc(), specially for
graphical effects and so on.

Bug: <https://bugzil.la/1787070>
Specification: <https://w3c.github.io/csswg-drafts/css-values/#math>
Standards Body: W3C (CSS Working Group)
Platform coverage: All
Preference: layout.css.trig.enabled
DevTools bug: N/A (I don't think DevTools supports anything too fancy in
calc(), and everything else already works).
Other Browsers:

* Safari: Shipped (since a while ago, not sure exactly)
* Chromium: Not yet implemented

web-platform-tests: There's a variety of tests in [1] testing this
feature (search for cos/tan/sin/pi/e/etc)

Let me know if there's any concern or what not.

Cheers,
-- Emilio

[1]: https://wpt.fyi/results/css/css-values

Tom Ritter

unread,
Oct 28, 2022, 12:14:17 PM10/28/22
to Emilio Cobos Álvarez, dev-pl...@mozilla.org
Do these functions use fdlibm or the underlying platform math
libraries? We've been working to cut all content-exposed uses of the
functions over to fdlibm to eliminate fingerprinting. (AudioContext
fingerprinting relies on the platform math libraries for example.)

-tom
> --
> You received this message because you are subscribed to the Google Groups "dev-pl...@mozilla.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform...@mozilla.org.
> To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/bbeeee40-b2fa-fea1-97e1-e45604cff82c%40mozilla.com.

Emilio Cobos Álvarez

unread,
Oct 28, 2022, 12:22:21 PM10/28/22
to Tom Ritter, dev-pl...@mozilla.org
On 10/28/22 18:14, Tom Ritter wrote:
> Do these functions use fdlibm or the underlying platform math
> libraries? We've been working to cut all content-exposed uses of the
> functions over to fdlibm to eliminate fingerprinting. (AudioContext
> fingerprinting relies on the platform math libraries for example.)

These use the Rust standard library functions (f32::cos, etc). Not sure
which of the two they use, but they are used in other web-exposed places
already (via transforms etc).

If they're not doing what you want, my guess is that we'd want to hook
those generically, rather than playing whack-a-mole.

-- Emilio
Reply all
Reply to author
Forward
0 new messages