Re: [csswg-drafts] [css-transitions] Transition to height (or width) "auto" (#626)

I feel like I'm going crazy reading similar things over and over for years. We should be able to just say "make it transition to the used value of `auto`" and be done with it. Just treat it as a number that can be interpolated to and from. 

The browsers already calculate the used value one way or another. And if they don't, then we can tell them to.

If `height: auto;` on a div results in the equivalent of `height: 507px`, then use that value (507px) for the transition with `auto`. If `width: auto;` on a div results in the equivalent of `width: 352px;`, then use that value (352px) for the transition with `auto`.

Browsers are capable of transitioning to and from specific values identical to the sizes that `auto` produces, so surely they can treat `auto` the same way it treats those values.

The only way that I could see it not working is if the used value of `auto` is somehow impossible to replicate with a manually set pixel value. But since that should *never* be the case, then this should work.

I'm betting we can easily eat the backwards compat on this, no issue. Maybe a handful of people using `transition: all` will be surprised to see their divs animating.

If there's a flicker at the beginning or end, that means that the browser isn't handling its own calculations properly, and that is a bug that the browsers need to fix. We shouldn't let what would correctly be labelled bugs prevent us from adding this feature.

Having the spec say something like, "Treat `auto` like its used value during transitions", is surely within the realm of possibilities.

-- 
GitHub Notification of comment by danegraphics
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/626#issuecomment-1869940471 using your GitHub account


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

Received on Wednesday, 27 December 2023 04:37:54 UTC