Web-Facing Change PSA: User action pseudo class top layer boundary

0 views
Skip to first unread message

Mason Freed

unread,
9:36 PM (2 hours ago) 9:36 PM
to blink-dev
Contact emails
mas...@chromium.org

Specification
https://www.w3.org/TR/selectors-4/#useraction-pseudos

Summary
This feature represents the behavior described in this section of the CSS spec: https://www.w3.org/TR/selectors-4/#useraction-pseudos which says that :hover, :active, and :focus-within match on the parents of elements, but only up to the first top layer element in the parent chain. The change for Chromium is that last "up to the top layer" part of this behavior. Concretely, this means that for this structure: ``` <main> <div popover> <button></button> </div> </main> <script>document.querySelector('[popover]').showPopover();</script> ``` if the user hovers the `<button>`, then the `:hover` pseudo class will match the `<button>`, and the popover, but will not match the `<main>` element. The rationale behind this change is that typically top layer elements are rendered "elsewhere", in a location that is disconnected from the parent element visually. So it typically does not make sense to change the styles of the parent element when the top layer element is hovered or activated, for example. The customizable-<select> implementation shipped in Chromium has this logic hard-coded for the specific case of the select `::picker()` popover. That special case logic will be removed when this feature ships.

Blink component
Blink>CSS

Web Feature ID
user-action-pseudos

Search tags
top layerpopover

Risks


Interoperability and Compatibility
While this is a behavioral change, in that the user action pseudos will no longer match across top layer boundaries, it is very unlikely to cause compat issues, because the old behavior was so broken. It is unlikely that a site is relying on that behavior intentionally. While it's possible they unintentionally did so, but in that case, this feature will effectively be a bug fix for those sites.

Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No information provided


Debuggability
No information provided

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?
No

Is this feature fully tested by web-platform-tests?
No




Tracking bug
https://crbug.com/407769114

Estimated milestones
Shipping on desktop149
DevTrial on desktop148
Shipping on Android149
DevTrial on Android148
Shipping on WebView149


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/6296574159355904

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages