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

> This :initial pseudo-class would match on the initial frame containing a particular element and be removed immediately after style recalc. This does mean we would have to repeat style on that initial frame - hopefully we could target only elements affected by :initial selectors.

Rather than thinking terms of "frames", it could make sense to express this as a way of bringing into existence a _before-change style_ when there otherwise would be none. It could work like this:

 - We resolve style for `<dialog>` (normally), `:initial` does not match, but we do note the existence of relevant `:initial` pseudo-classes. (This is similar to how ::before/etc is handled in Blink). This is the _after-change style_, same as today.
 - At the point where we want to trigger a transition, we'd normally say "sorry, no before-change style, no transition". But, since we've noted that `:initial` comes into play, we do an on-the-spot style resolution to produce that before-change style (this time with `:initial` matching). Then we calculate the transition normally.



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


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

Received on Wednesday, 7 December 2022 11:56:55 UTC