- From: valentin richard <notifications@github.com>
- Date: Tue, 23 Jun 2026 00:00:05 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 23 June 2026 07:00:09 UTC
lifaon74 left a comment (whatwg/dom#1081)
> Write down a description of the underlying problem you’re trying to solve. What are the use cases? A use case is an actual user wanting to do something. Then list requirements for each use case.
Perform a css selector match from a child to a parent instead of the opposite. Example:
```ts
// assume `child` is a variable on an HTMLElement, and `this` a variable on a CustomElement.
if (child.matches(':scope > ul > li:nth-child(even)', { scope: this.shadowRoot })) {
// is `child` an even element into a list present in this custom-element ?
child.dataset['even'] = '';
}
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1081#issuecomment-4776576861
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/dom/issues/1081/4776576861@github.com>
Received on Tuesday, 23 June 2026 07:00:09 UTC