Re: [csswg-drafts] [css-contain-3][css-animations][css-transitions] Isolate animation side-effects? (#6398)

> One notable difference with the proposal is that I think setting a property equal to its current animation value normally would have no effect but with your proposed change would start a transition. We could probably carve out an exception for this given that we need to compute the current value to start from anyways.

Not sure if by "current animation value" you mean only effects from CSS/Web-Animations, only effects from transitions, or effects from all of them.

For _transitions_ happening on the same element, it looks like the [transition would be canceled](https://www.w3.org/TR/css-transitions-1/#starting:~:text=If%20the%20current%20value%20of%20the%20property%20in%20the%20running%20transition%20is%20equal) in both the current and proposed behavior.

For CSS/Web _animations_ happening on the same element, I think you're right. And yes I suppose we could check the current value for any animations and special-case on that, if necessary.

For transitions/css/web-animations effects _inherited_ from ancestors, I don't think we can do tricks like that. It would just start/update transitions as if no transitions/animations take place in the document.

> We would still compute the current effect value from the replaced transition (e.g. left: 50px)?

Yes.

> Does this mean the entire descendant style which matches the container query would be "animated style" rather than base style? E.g. the following wouldn't start an animation on #b?

That's right. Animations/transitions are only interpreted on the before/after (base) styles, so if `#a`'s width is less than `500px` in the after-change style, `#b` does not get the `animation` property applied in the after-change style either.

I was originally going to also say: `#b` will still ultimately end up with a value `getComputedStyle(b).animationName == 'grow'`, but this is considered a side-effect of `#a`'s animation effect, and therefore, to satisy animations-do-not-trigger-animations, an animation can't be triggered.

However, it probably makes more sense to specify that the computed values of `animation-` and `transition-` properties on the animated style are forced to the corresponding values on the after-change style. That way `gCS()` matches reality to a greater degree.


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


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

Received on Friday, 25 June 2021 08:45:41 UTC