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

The CSS Working Group just discussed `Transforms`, and agreed to the following:

* `RESOLVED: clamp to 1px for both getComputedStyle() and interpolation as well`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Transforms<br>
&lt;fremy> TabAtkins: but patent protection was not part of this, and this is not ideal<br>
&lt;TabAtkins> Like, look at the issues list, showing definite cross-browser discussion https://github.com/WICG/visual-viewport/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6320<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6346<br>
&lt;fantasai> dbaron[m]: Discussing 6320 and 6346 together<br>
&lt;fantasai> dbaron[m]: Group resolved that values less than 1px should be clamped to minimum of 1px<br>
&lt;fantasai> dbaron[m]: At the time, discussed as a render-time clamp<br>
&lt;fantasai> dbaron[m]: I tried implementing this. Believe I was the first<br>
&lt;fantasai> dbaron[m]: in the process, became clear that the time at which it became clamped was the time you convert to a matrix<br>
&lt;fantasai> dbaron[m]: problem with zero is that it puts infinite components into the matrix<br>
&lt;fantasai> dbaron[m]: There are 3 different ways convert to a matrix<br>
&lt;fantasai> dbaron[m]: 1) need to render, to find used value<br>
&lt;fantasai> dbaron[m]: 2) find resolved value for gCS()<br>
&lt;fantasai> dbaron[m]: computed value of transform function is "as specified with lengths made absolute"<br>
&lt;fantasai> dbaron[m]: but resolved value is a matrix<br>
&lt;fantasai> dbaron[m]: The third one, which is maybe more interesting, is interpolation<br>
&lt;fantasai> dbaron[m]: Perspective function gets interpreted as matrices<br>
&lt;fantasai> dbaron[m]: if you were to not clamp, and then interpolate from 0 to 2px,<br>
&lt;fantasai> dbaron[m]: entire range of animation would be clamped to 1px during render time, because animating from infinity to 0.5<br>
&lt;fantasai> dbaron[m]: which crosses 1 basically right when it gets to 0.5<br>
&lt;fantasai> dbaron[m]: Conclusion was do the clamp anytime I convert to matrices<br>
&lt;fantasai> dbaron[m]: so for gCS and for interpolation also<br>
&lt;fantasai> dbaron[m]: I've already implemented this in Canary ... does anyone think we should do something different?<br>
&lt;fantasai> dbaron[m]: not clear to me what that could be<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/6320<br>
&lt;fantasai> smfr: Seems fine. What happens when perspective property or transform with only perspective, not converting matrices, do we need to describe beahvior there?<br>
&lt;fantasai> dbaron[m]: for perspective property, group explicitly resolved in 3084 that the animation should be different<br>
&lt;fantasai> dbaron[m]: so perspective property should interpret as specified<br>
&lt;fantasai> dbaron[m]: 2nd point, spec says that even a perspective() on its own gets interpolated as matrix<br>
&lt;fantasai> dbaron[m]: it describes the rules for interpolating matrix and perspective as the same thing<br>
&lt;fantasai> dbaron[m]: so decompose and do the pieces<br>
&lt;fantasai> dbaron[m]: for perspective it's trivial<br>
&lt;fantasai> dbaron[m]: but still the decomposition that gets interpolated is the matrix component, so ?? reciprocal<br>
&lt;fantasai> smfr: so that part is affected by your proposal<br>
&lt;fantasai> dbaron[m]: yes<br>
&lt;fantasai> smfr: I think it's reasonable<br>
&lt;fantasai> smfr: As long as we agree on where conversions to matrices happen<br>
&lt;fantasai> dbaron[m]: issues I filed are in terms of this should happen for inteprolation and this shoul dhappen or gCS<br>
&lt;fantasai> dbaron[m]: but rational was "wherever convert to matrix"<br>
&lt;fantasai> smfr: sounds fine<br>
&lt;fantasai> astearns: So original resolution for 413, did that cover resolved value?<br>
&lt;fantasai> dbaron[m]: no, said "for purpose of rendering"<br>
&lt;fantasai> astearns: so have a resolution for rendering, and you're saying extend to interpolation and resolved value<br>
&lt;fantasai> astearns: any other opinions?<br>
&lt;fantasai> astearns: ... implementation detail?<br>
&lt;fantasai> dbaron[m]: when editing spec, I'll see if it makes sense to fit that note in<br>
&lt;fantasai> [scribe missed, but guesses note was about the "convert to matrix" rationale]<br>
&lt;fantasai> RESOLVED: clamp to 1px for both getComputedStyle() and interpolation as well<br>
&lt;fantasai> dbaron[m]: possible not web-compatible, but can figure that out when we have data<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6320#issuecomment-862536887 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 16 June 2021 16:44:24 UTC