Skip to content

[css-properties-values-api] Interpolations for registered properties <transform-list>/<transform-function>/none #9522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lilles opened this issue Oct 25, 2023 · 3 comments

Comments

@lilles
Copy link
Member

lilles commented Oct 25, 2023

During code reviews for implementing interpolation of <transform-function> and <transform-list>, a question came up about none and also the compatibility of <transform-function> and <transform-list>.

My conclusion, which is matching Safari's implementation is that none is not magical, so that for a syntax none|<transform-list> or none|<transform-function>, none is not a transform value that can be interpolated to or from if the other end point is a <transform-list> (or function).

The other part is if you have a syntax <transform-function>|<transform-list>, you cannot interpolate between a single function and a list of functions. However, if you flip the syntax to <transform-list>|<transform-function>, the values will always match the first part, and they will interpolate. This matches the implementation in Safari and the in-progress implementation in Chrome.

This issue is to confirm my interpretation is correct. What can be confusing is that the spec says <transform-function> and <transform-list> should interpolate as the standard transform property.

@tabatkins @andruud @kevers-google

@zrhoffman
Copy link

Agreed that value none should be animated discretely for syntaxes none|<transform-list> or none|<transform-function>, but I think none should be interpolated for syntaxes <transform-list>|none or <transform-function>|none.

From css-properties-values-api <https://github.com/w3c/css-houdini-drafts/blob/808c87a30bea/css-properties-values-api/Overview.bs#L306-L308>:

For syntaxes specified with the | combinator, the computed value is given by applying the computed-value rules for the first clause that matches the value.

If so, the expectations for WPT <https://github.com/web-platform-tests/wpt/blob/1a18de6ee35d/css/css-properties-values-api/animation/custom-property-animation-transform-none.tentative.html> should be updated, and testcases added for syntaxes none|<transform-list> and none|<transform-function>.

@tabatkins
Copy link
Member

Ooh, I'd forgotten there was an order dependency there. Yes, I agree this is the specified behavior.

Weird that transform-function and transform-list can't interpolate. We should probably special-case that.

but I think none should be interpolated for syntaxes |none or |none.

none isn't a transform function at all, so it shouldn't work either way, as currently written.

@zrhoffman
Copy link

but I think none should be interpolated for syntaxes |none or |none.

none isn't a transform function at all, so it shouldn't work either way, as currently written.

Ah okay. I misunderstood this part <https://github.com/w3c/csswg-drafts/blob/d661b595fde4/css-transforms-2/Overview.bs#L726-L728>:

When translate, rotate or scale are animating or transitioning, and the from value or to value (but not both) is none, the value none is replaced by the equivalent identity value (0px for translate, 0deg for rotate, 1 for scale).

But yeah, it should still only animate discretely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants