Re: [csswg-drafts] [selectors-4] Add pseudo-class to establish before-change style for css-transitions on new elements. (#8174)

So just to be a little more precise about semantics, I think this is the behavior we're going for:

1. Whenever we style an element, notice it has a transitionable property, but that property lacks a "before-change" style (such as if it was previously `display: none`, or newly inserted into the document), then:
2. We recompute style for that element, but this time include all the rules inside of `@initial` blocks (cascading as normal, just the same as if they were in an `@media` or something). The result of this styling is used as the before-change style.
3. If the before-change styles result in the element still not having style (because a rule in `@initial` made it `display:none`, for example), it'll act as today, not having a before-change style.
4. Today's default behavior is maintained, since if you don't have any `@initial` rules, then the result of recomputing style will just give you the exact same results, and so none of the transitionable properties will see a change. (In practice, we'll figure out if an element can possibly be affected by `@initial` sometime earlier and early-exit.)

Does this all sound correct? Are there any details I'm missing?

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


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

Received on Monday, 17 April 2023 23:48:27 UTC