- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 11 Jan 2023 17:22:10 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `Pseudo-class before-change style for transitions on new elements`. <details><summary>The full IRC log of that discussion</summary> <fantasai> Topic: Pseudo-class before-change style for transitions on new elements<br> <Rossen_> q?<br> <fantasai> github: https://github.com/w3c/csswg-drafts/issues/8174<br> <fantasai> flackr: when coming from display:none have no display style<br> <fantasai> ... so can't define a from state<br> <fantasai> ... can define in CSS animation, but less ergonomic<br> <fantasai> ... so proposing we add an :initial pseudo-class which establishes the initial style<br> <fantasai> ... the before-change style for CSS transitions<br> <fantasai> ... in discussion, decided that if we made this a pseudo-element<br> <chris> rrsagent, here<br> <RRSAgent> See https://www.w3.org/2023/01/11-css-irc#T17-10-12<br> <fantasai> ... we could optimize this by preventing e.g. sibling selectors and only require occasional style calculation when it's used<br> <fantasai> ... so proposal is to have ::initial establish the initial style<br> <emilio> q+<br> <Rossen_> q?<br> <Rossen_> ack emilio<br> <fantasai> emilio: This would be a pseudo-element that matches against an element?<br> <fantasai> emilio: so matches element rules plus magic pseudo-element?<br> <fantasai> pseudo-element would be applied on top of element rules<br> <fantasai> emilio: that's pretty different from pseudo-element<br> <fantasai> emilio: I don't think we have a precedence for this, which is a bit tricky<br> <fantasai> emilio: I'm also confused when you want it<br> <fantasai> emilio: this is for coming back from display:none?<br> <fantasai> emilio: seems implementable, but seems tricky and weird to make it a pseudo-element<br> <fantasai> emilio: because targetting two element styles on one<br> <fantasai> emilio: weird wrt cascade<br> <fantasai> flackr: that's good feedback for pseudo-element approach<br> <fantasai> flackr: could also take pseudo-class approach, but less easily optimizable?<br> <fantasai> emilio: in what sense?<br> <fantasai> flackr: if you have combinator selectors, element showing up in the DOM can cause recalcuation<br> <fantasai> emilio: but that's the case for all pseudo-element<br> <fantasai> flackr: this is extra style recalc that doesn't normally exist<br> <fantasai> emilio: I'm a bit confused, you recalc more if you have :initial along the combinators.... depending how wel you optimize<br> <fantasai> flackr: I think given :initial is only establishing before-change style and otherwise doesn't apply to the element, not that weird that it conflicts with other styles<br> <fantasai> flackr: because those other styles can't initiate transitions from display: none<br> <fantasai> emilio: we have a similar case with pseudo-classes for links<br> <fantasai> emilio: need to resolve :visited / :unvisitied, need to do unconditionally, but dont' understand why :initial would be slower<br> <fantasai> flackr: if initial is a pseudo-class, can be used as part of combinator selectors<br> <fantasai> flackr: so have to resolve all those combinators<br> <fantasai> flackr: but if pseudo-element, can't be used in those combinators<br> <fantasai> emilio: for :visited we have special case<br> <fantasai> emilio: basically :visited on left of sibling is ignored<br> <fantasai> flackr: ah, we could do that<br> <fantasai> emilio: the way I think of implementing it is, we have this element ...<br> <fantasai> emilio: otherwise :initial only matches rightmost compound<br> <fantasai> flackr: that sounds reasonable to me<br> <fantasai> emilio: that would be less weird<br> <futhark> q+<br> <fantasai> +1 to emilio<br> <Rossen_> ack futhark<br> <fantasai> futhark: ignoring the pseudo-class, when resolving selectors, would have already computed style for previous one so would have eixsting computed style<br> <fantasai> futhark: so :initial wouldn't match on those elements<br> <fantasai> emilio: Right. :initial can only match in this special case<br> <fantasai> emilio: "this element is now :initial", now compute<br> <fantasai> emilio: with :has() have similar dependency...<br> <fantasai> futhark: Similar if getComputedStyle() in display:none subtree<br> <fantasai> futhark: You need to ensure you have styles there to do inherit etc.<br> <fantasai> emilio: not for siblings, but for ancestors<br> <fantasai> emilio: I'd rather say that it only matches on the rightmost<br> <flackr> +1<br> <chrishtr> +1<br> <fantasai> fantasai: How does this interact with page loading, partly loading?<br> <fantasai> flackr: applies anytime the element first gets a layout box<br> <emilio> q+<br> <fantasai> flackr: this would apply any time you add element to a page<br> <fantasai> flackr: separate issue for avoiding running things during load<br> <fantasai> flackr: but this is pre-existing problem for animations, which run on page load<br> <fantasai> Rossen_: So based on description, this would not fire on display:contents ?<br> <fantasai> Rossen_: since it doesn't have a box?<br> <fantasai> flackr: that sounds right<br> <Zakim> fantasai, you wanted to ask how this interacts with loading<br> <Rossen_> ack fantasai<br> <Rossen_> ack emilio<br> <fantasai> emilio: I think I'd rather special-case it to display:none since that's the actual thing<br> <PaulG> q+<br> <futhark> +1 to emilio.<br> <fantasai> emilio: at least, I don't think display:contents stops animations in the subtree, whereas display:none does<br> <Rossen_> ack PaulG<br> <fantasai> PaulG: If we're leaning towards pseudo-element, how would that affect AX tree?<br> <fantasai> PaulG: if not supposed to be animated at that time, just want to make sure we consider that<br> <fantasai> flackr: don't think we're leaning towards the pseudo-element approach<br> <fantasai> flackr: but not intenteded to establish a separate elmeent, just style the real element in the before-change state<br> <Rossen_> ack fantasai<br> <fantasai> fantasai: Suggest maybe flackr and emilio can come back with a revised proposal, and we can move to other issues<br> <fantasai> flackr: fwiw, AX should be equivalent to animations<br> <fantasai> Rossen_: ok, let's end here<br> <fantasai> Rossen_: come back when you're ready, thanks for introducing<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8174#issuecomment-1379224022 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 11 January 2023 17:22:12 UTC