- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Wed, 08 Jan 2025 17:56:07 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `[selectors] Pseudo-class to indicate when a slot has content`, and agreed to the following: * ``RESOLVED: `:has-slotted` should match when the fallback content is not being displayed`` <details><summary>The full IRC log of that discussion</summary> <kbabbitt> keithamus0: tldr from thread is chrome has :slotted, it can match on a few different things<br> <kbabbitt> keithamus0: concept of flattened vs non-flattened tree<br> <kbabbitt> ... flagged in firefox and chrome as non-flattened tree<br> <kbabbitt> ... so it can match direct descendant of a slot<br> <kbabbitt> ... some contention around this<br> <kbabbitt> ... setting flattened to true would mean it would make child slots transparent effectively<br> <kbabbitt> ... so if you have a slot slotted by another slot then that slot [missed]<br> <kbabbitt> ... my opinion is we should keep behavior as-is<br> <kbabbitt> ... that's the only way you can match slotted content<br> <kbabbitt> ... even if it's just a text node as a descendant of a slot element<br> <kbabbitt> ... web components cg is asking for commitment that this is acceptable<br> <emilio> q+<br> <kbabbitt> ... as long as we define the alternatives to that<br> <astearns> ack rachelandrew<br> <kbabbitt> ... chief use cases are: has my slot been populated? what has it been populated with?<br> <astearns> ack emilio<br> <kbabbitt> emilio: flattened true and flattened false - only effective difference is nested slots right?<br> <kbabbitt> keithamus0: that's true, has-slotted will always match populated text nodes<br> <kbabbitt> ... nested slots become transparent<br> <kbabbitt> [missed some context]<br> <kbabbitt> keithamus0: how do you determine nested slots is the short summary<br> <kbabbitt> emilio: to me, flattened tree behavior is what I'd expect as an author<br> <kbabbitt> ... components that use nested slots... that becomes useless<br> <kbabbitt> ... a bit confused about when you'd want to differentiate between useful slotted content and empty slot<br> <kbabbitt> ... why would you want flattened behavior?<br> <kbabbitt> keithamus0: other way around makes more sense for that use case, am I displaying default slotted content<br> <kbabbitt> emilio: right but if you have an empty slot you could do that?<br> <kbabbitt> keithamus0: I don't think so?<br> <kbabbitt> ... will have to test<br> <kbabbitt> emilio: my understanding is that you'd display default content of nested slot<br> <dbaron> (that would be my assumption ^)<br> <kbabbitt> ... flattened behavior is easier but I'm surprised that's most useful<br> <kbabbitt> ... would not object but might be worth checking<br> <kbabbitt> ...ideally has-slotted should reflect fallback content<br> <kbabbitt> keithamus0: agree, that's my understanding of what flattened false would do<br> <kbabbitt> emilio: assuming that's the case flattened false seems reasonable<br> <kbabbitt> ... if you want we can resolve that we make has-slotted match fallback content<br> <keithamus0> PROPOSED RESOLUTION: `:has-slotted` should match when the fallback content is not being displayed<br> <kbabbitt> astearns: doesn't mention flat tree deliberately<br> <kbabbitt> ... but if it turns out flat tree is desired behavior, [?]<br> <kbabbitt> keithamus0: need to confirm<br> <kbabbitt> ... whether a slot would display fallback content<br> <kbabbitt> ... but if that's the case it shouldn't use the flat tree, but if it isn't then it should<br> <kbabbitt> RESOLVED: `:has-slotted` should match when the fallback content is not being displayed<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-2578290276 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 8 January 2025 17:56:08 UTC