Re: [csswg-drafts] [selectors] Pseudo-class to indicate when a slot has content (#6867)

[Tested](https://lit.dev/playground/#gist=15f7e26306e5a6a65918def2c838eaaf) `:has-slotted` in Chrome Canary with the "experimental web platform features" setting on. 

The behavior is good for simple cases but not useful for nested composition. Perhaps this can be solved via https://github.com/w3c/csswg-drafts/issues/10771.

| Content | Expected | Actual | assignedNodes() | assignedNodes({flatten: true}) | :has-slotted works | ::slotted(*) |
|---------|:--------:|:------:|:---------------:|:------------------------------:|:------------------:|:------------:|
| `<glow-stuff></glow-stuff>` | no&nbsp;glow | no&nbsp;glow | `[]` | `[]` | yes | no&nbsp;match |
| `<glow-stuff><input></glow-stuff>` | glow | glow | `[<input>]` | `[<input>]` | yes | match |
| `<template shadowRootMode="open"><glow-stuff><slot></slot></glow-stuff></template>` | no&nbsp;glow | glow | `[<slot>]` | `[]` | no | no&nbsp;match |
| `<template shadowRootMode="open"><glow-stuff><slot></slot></glow-stuff></template><input>` | glow | glow | `[<slot>]` | `[<input>]` | by&nbsp;luck | match |
| `<template shadowRootMode="open"><glow-stuff><slot><input></slot></glow-stuff></template>` | glow | glow | `[<slot>]` | `[<input>]` | by&nbsp;luck | no&nbsp;match |



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


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

Received on Saturday, 5 October 2024 17:05:13 UTC