Re: [csswg-drafts] [css-ui] select:hover and select:active styles (#11185)

The CSS Working Group just discussed `[css-ui] select:hover and select:active styles`.

<details><summary>The full IRC log of that discussion</summary>
&lt;noamr> dbaron: the issue came up from customizable select<br>
&lt;noamr> dbaron: look at the screen capture in the issue<br>
&lt;noamr> dbaron: I believe the issue is showing with the default UA styles for customizable select<br>
&lt;noamr> dbaron: whether or not it should be part of the UA styles is separate<br>
&lt;noamr> dbaron: regardless of the default UA styles, these would be custom styles people would want to write for customizable select and others<br>
&lt;noamr> dbaron: the problem is that :hover and :active are hierarchical<br>
&lt;noamr> dbaron: where this shows with customizable select, is that if you hover an option in the popup of the select, it makes the customizable select "hover"<br>
&lt;noamr> dbaron: CSS can't distinguish between "the select is being hovered" and "something in the select is being hovered, e.g. a popup"<br>
&lt;noamr> dbaron: masonf suggested that we break the hierarchical nature of :hover/:active for the top layer<br>
&lt;noamr> dbaron: putting something in the top layer is a strong indication that you probably don't want the hierarchical hover/select behavior<br>
&lt;noamr> dbaron: welcome to chime in on how to word it, but less important for the call<br>
&lt;noamr> dbaron: I want to get consensus that this is a reasonable direction<br>
&lt;JakeA> Seems reasonable<br>
&lt;ydaniv> +1<br>
&lt;noamr> astearns: just hover and active? Or other hierarchical pseudos?<br>
&lt;joshtumath> +1 to making an exception for top-layer<br>
&lt;JakeA> focus?<br>
&lt;noamr> dbaron: I think it's just :hover and :active? Not sure about :focus-within<br>
&lt;noamr> dbaron: Haven't thought deeply about :focus-within, maybe not.<br>
&lt;noamr> masonf: makes more sense to keep current behavior for :focus-within<br>
&lt;JakeA> q+<br>
&lt;dholbert> q+<br>
&lt;noamr> fantasai: :focus-within is sometimes used specifically for this, e.g. that the focus is within the popup, so would not change it<br>
&lt;noamr> astearns: if we make this change, can we somehow enable the current hierarchical behavior?<br>
&lt;miriam> :hover:not(:has(:hover))<br>
&lt;noamr> dbaron: you could do it with :has<br>
&lt;noamr> dbaron: doable, but the vast majority case here is what we propose<br>
&lt;noamr> masonf: +1, it's the most common case<br>
&lt;astearns> ack JakeA<br>
&lt;noamr> JakeA: would the same happen for JS events related to hover/<br>
&lt;ydaniv> q+<br>
&lt;noamr> dbaron: I don't think we will currently be proposing this<br>
&lt;noamr> dbaron: not proposing DOM event changes<br>
&lt;vmpstr> q+<br>
&lt;JakeA> q+<br>
&lt;noamr> masonf: +1, in CSS this is confusing, but in JS changing bubbling in this way would be confusing<br>
&lt;astearns> ack dholbert<br>
&lt;noamr> dholbert: one use of :hover is to show which a element would be activated<br>
&lt;noamr> dholbert: would that change that behavior?<br>
&lt;noamr> dbaron: probably true. It's probably a bad idea to put interactive content inside an A element.<br>
&lt;astearns> ack ydaniv<br>
&lt;noamr> noamr: recursive interactive elements are against ARIA guideliens<br>
&lt;noamr> ydaniv: this is the default behavior for menus, working as we expected. So this would be breaking menus<br>
&lt;noamr> dbaron: there is a q of whether menus are in the top layer?<br>
&lt;noamr> masonf: It depends on how you construct the DOM tree to build the menu<br>
&lt;noamr> masonf: the prev example does do exactly that - you can currently activate a link from within the top layer<br>
&lt;noamr> ydaniv: I think people rely on the current hover behavior<br>
&lt;noamr> masonf: It's still possible to do that<br>
&lt;noamr> masonf: are you saying there might be a compat issue?<br>
&lt;noamr> ydaniv: yes<br>
&lt;noamr> masonf: need to explore compat<br>
&lt;astearns> ack vmpstr<br>
&lt;noamr> vmpstr: in carousel scroll-marker/group have the same problem, as when items are hovered the element is hovered. there is no top layer there. perhaps the solution is not about top-layer<br>
&lt;kizu> q+<br>
&lt;astearns> ack JakeA<br>
&lt;noamr> JakeA: perhaps a CSS property that creates a boundary for active/hover etc?<br>
&lt;noamr> JakeA: that can be in the UA stylesheet<br>
&lt;noamr> q+<br>
&lt;masonf> q+<br>
&lt;noamr> vmpstr: that would work for my use case<br>
&lt;astearns> ack kizu<br>
&lt;noamr> kizu: I think a CSS property might be dangerous, we try not to create loops<br>
&lt;noamr> kizu: maybe an HTML attribute?<br>
&lt;noamr> kizu: like enabling it by default for select and not other elements?<br>
&lt;JakeA> good point about the loop. It's always the loop<br>
&lt;bramus> scribe+<br>
&lt;astearns> ack noamr<br>
&lt;bramus> noamr: perhaps we can use overflow for this?<br>
&lt;bramus> … if an el is hovered and has an area outside of its normal overflow and that is hovered, then the element itself is probably not hovered<br>
&lt;bramus> … not going to help people relying on it today, but better than relyigng on top layer<br>
&lt;bramus> … not sure<br>
&lt;bramus> q+<br>
&lt;noamr> dbaron: that might get too many other cases where we want the hierarchical behavior<br>
&lt;astearns> ack masonf<br>
&lt;noamr> masonf: I really like the idea of a CSS property<br>
&lt;noamr> masonf: an attribute can be a lot cleaner<br>
&lt;astearns> q+<br>
&lt;noamr> vmpstr: should be CSS, because it's pseudo-elements<br>
&lt;noamr> dbaron: I think we already have solutions for loops for hover/active<br>
&lt;noamr> dbaron: we already break loops for hover/active<br>
&lt;noamr> dbaron: as long as we don't also touch other things like focus within<br>
&lt;noamr> masonf: how does it break the loop?<br>
&lt;noamr> dbaron: we don't have spec definitions/interop, but we break loops. I think we update it only once for refresh cycles<br>
&lt;noamr> kizu: in Safari/firefox it doesn't exactly work<br>
&lt;noamr> dbaron: hover/active already fully have this problem<br>
&lt;astearns> ack bramus<br>
&lt;noamr> bramus: would this also apply to regular select, or only customizable select?<br>
&lt;bramus> https://codepen.io/bramus/pen/GgKWmVg/6a7fa40ecea75e5f07e423d32cc07a7f<br>
&lt;noamr> masonf: the old style select doesn't set hover<br>
&lt;noamr> bramus: it does, see demo ^^^<br>
&lt;noamr> bramus: they apply in chrome/safari, not firefox<br>
&lt;noamr> dbaron: I wouldn't be surprised if it's OS specific as well<br>
&lt;noamr> q+<br>
&lt;ydaniv> q+<br>
&lt;noamr> masonf: one key difference is that you can do interesting things with the options, but not here<br>
&lt;noamr> astearns: a bit concerned making special case for top-layer when it catches thing that we might not want to catch, and might not work for non-top-layer things<br>
&lt;noamr> astearns: maybe go back to the issue?<br>
&lt;astearns> ack noamr<br>
&lt;astearns> ack astearns<br>
&lt;bramus> noamr: maybe can be another contain? As in “your hover is contained”. perhaps can do something like that. Need to think about it further.<br>
&lt;astearns> ack ydaniv<br>
&lt;noamr> ydaniv: contain might put us in a loop? Perhaps a new hover-*/active-* sort of things that don't bubble?<br>
&lt;kizu> https://codepen.io/kizu/pen/GgKWEZp — CSS hover loop example, behaves differently in Chrome, Safari, and Firefox (but, well, works)<br>
&lt;noamr> astearns: taking back to the issue<br>
&lt;noamr> 17:04 &lt;astearns> github-bot, take up https://github.com/w3c/csswg-drafts/issues/9141<br>
</details>


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


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

Received on Wednesday, 18 December 2024 17:26:09 UTC