Re: [csswg-drafts] [css-overflow-5] :focus and :focus-within styles with focused scroller pseudo-element (#11361)

The CSS Working Group just discussed `[css-overflow-5] :focus and :focus-within styles with focused scroller pseudo-element`, and agreed to the following:

* `RESOLVED: The document.activeElement is the scroll container for a focused ::scroll-marker or ::scroll-button. :focus matches only on the specific focused pseudo-element. :focus-within matches on the ::scroll-marker-group for ::scroll-marker, and the scroll container and all ancestors for both ::scroll-marker and ::scroll-button`

<details><summary>The full IRC log of that discussion</summary>
&lt;andreubotella> flackr: Scroll markers and scroll buttons are focusable, and we need to have reasonable behavior for the active element and :focus and :focus-within pseudos<br>
&lt;andreubotella> flackr: the focus elment has to be an element, or it would break existing content<br>
&lt;andreubotella> flackr: similar to shadow dom<br>
&lt;andreubotella> flackr: similar to shadow dom where the host is focused, the scrolling container is the host of the pseudoelements<br>
&lt;andreubotella> flackr: the :focus and :focus-within pseudos follow the existing behavior, so :focus only matches on the pseudo which is focused, and :focus-within matches on the scroll container and the scroll marker group<br>
&lt;andreubotella> flackr: and any ancestor of the scroll container<br>
&lt;andreubotella> flackr: if you have a focused element, that's the thing that has focused and the ancestors have :focus-within<br>
&lt;andreubotella> flackr: this does the same for pseudos with the requirement that it needs to be an element<br>
&lt;flackr> Proposed resolution: The document.activeElement is the scroll container for a focused ::scroll-marker or ::scroll-button. :focus matches only on the specific focused pseudo-element. :focus-within matches on the ::scroll-marker-group for ::scroll-marker, and the scroll container and all ancestors for both ::scroll-marker and ::scroll-button<br>
&lt;andreubotella> RESOLVED: The document.activeElement is the scroll container for a focused ::scroll-marker or ::scroll-button. :focus matches only on the specific focused pseudo-element. :focus-within matches on the ::scroll-marker-group for ::scroll-marker, and the scroll container and all ancestors for both ::scroll-marker and ::scroll-button<br>
&lt;fantasai> scribenick: fantasai<br>
&lt;emilio> It looks reasonable, but flackr is there any way for script to detect whether the scroll container or a marker is focused?<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11361#issuecomment-2607770396 using your GitHub account


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

Received on Wednesday, 22 January 2025 16:55:01 UTC