W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2021

[csswg-drafts] [css-transforms-2] clamping of perspective() function to >= 1px should affect interpolation (#6320)

From: L. David Baron via GitHub <sysbot+gh@w3.org>
Date: Thu, 27 May 2021 20:57:54 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-904182843-1622149072-sysbot+gh@w3.org>
dbaron has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-transforms-2] clamping of perspective() function to >= 1px should affect interpolation ==
Note: #3084, where the group decided to keep interpolation of the `perspective` property and the `perspective()` transform function different, is relevant background to this issue.  Because of that decision, this issue applies only to the `perspective()` transform function and not to the `perspective` property.

The [rules for interpolation of `perspective`](https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions) say that `perspective()` functions are interpolated as matrices.

The [definition of the `perspective()` function] says:
> If the depth value is less than 1px, it must be treated as 1px for the purpose of rendering.

It's not clear how this affects interpolation, since "for the purpose of rendering" probably doesn't include interpolation.  However, since perspective values less than 1px rapidly lead the [relevant component of the matrix](https://drafts.csswg.org/css-transforms-2/#PerspectiveDefined) to approach infinity, an animation from `perspective(0)` to some other `perspective()` value will spend most of its time between `0` and `1px`, which probably isn't desirable.

It seems like it's probably useful to say that the clamping to `1px` also affects interpolation endpoints, so that this doesn't happen.  I think this would also be helpful for implementations since they don't need to worry about handling infinite or near-infinite values in matrices (like in [Chromium issue 1205161](https://bugs.chromium.org/p/chromium/issues/detail?id=1205161), which is how I ended up here in the first place).  On the other hand, it does add extra rules for handling what is basically an error case.

I'm curious what other folks think here.  cc: @smfr @mattwoodrow @birtles.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6320 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 27 May 2021 20:57:56 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:23 UTC