Re: [csswg-drafts] [css-pseudo-4] single highlight pseudo for find-in-page? (#10212)

The CSS Working Group just discussed `[css-pseudo-4] single highlight pseudo for find-in-page?`, and agreed to the following:

* `RESOLVED: Add ::search-text, using :current to distinguish currently-focused match, mark as optional to implement`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> florian: We have this set of highlight pseudo-elements that lets you restyle how UA styles spelling-error, selection, etc.<br>
&lt;fantasai> florian: as part of that family, being able to restyle browser's find-in-page has been proposed<br>
&lt;fantasai> florian: also discussed whether to highlight active vs inactive<br>
&lt;fantasai> florian: the underlying question, does that even work? E.g. in Safari, wouldn't restyle how browser does it already<br>
&lt;fantasai> florian: Safari does it as an overlay<br>
&lt;fantasai> florian: we would need some way to say not to do the overlay, or accept double-styling, or ...<br>
&lt;fantasai> florian: So what pseudo-classes do we need, and how do we do it?<br>
&lt;fantasai> schenney: Issues on agenda due to trying to prototype<br>
&lt;fantasai> schenney: in Chromium<br>
&lt;fantasai> schenney: both Firefox and Safari convert the matched text to ::selection when the UI for find-in-page is exited<br>
&lt;fantasai> schenney: I don't think that's a problem, but we may need to define what happens there<br>
&lt;fantasai> schenney: If people think this is a horrible idea, should say so. So first, any objections to prototyping?<br>
&lt;fantasai> florian: no objection to prototyping, but should have some idea of how it should work in e.g. Safari<br>
&lt;fantasai> florian: doesn't mean don't do it, but know what it means<br>
&lt;fantasai> schenney: ... I don't think Safari has reasonable path to implementing<br>
&lt;fantasai> florian: one approach is Safari doesn't implement the syntax<br>
&lt;fantasai> florian: but also part of defining is defining painting order<br>
&lt;fantasai> florian: is this an area where we can pick an answer, or will browsers need different answers<br>
&lt;fantasai> florian: Unlike other pseudos, where we seem to have agreement on what we do in the page, there's more variation here<br>
&lt;fantasai> florian: could come up with an answer, and ask Safari people to answer in question<br>
&lt;fantasai> Rossen: fallback is?<br>
&lt;fantasai> florian: you try to style something and it doesn't get styled<br>
&lt;vmpstr> q+<br>
&lt;fantasai> smfr's comment btw: https://github.com/w3c/csswg-drafts/issues/10212#issuecomment-2086545393<br>
&lt;fantasai> Rossen: seems we have one UA that unlikely to implement in forseeable future if ever<br>
&lt;vmpstr> q-<br>
&lt;fantasai> Rossen: maybe loose language in terms of "may" rather than "must"<br>
&lt;fantasai> Rossen: and safe fallback<br>
&lt;fantasai> florian: We should specify the feature in terms of "must" as in "if you support the feature, do it this way, but it's optional to support the feature"<br>
&lt;fantasai> florian: otherwise hard for authors to know how to do the styling, if allowed to do it in multiple ways<br>
&lt;fantasai> schenney: back to issue, what do we name this pseudo-element?<br>
&lt;fantasai> schenney: proposal is to name it ::search-text, consistent with ::target-text<br>
&lt;fantasai> schenney: and then to add :active pseudo-class to style active vs inactive differently<br>
&lt;fantasai> florian: this seems reasonable to me<br>
&lt;fantasai> florian: active vs inactive is if multiple words highlighted, and one is currently focused?<br>
&lt;fantasai> florian: this is a UI feature, not required to highlight multiple<br>
&lt;fantasai> florian: if highlighting several, one is active and others inactive; if highlighting multiple, then what?<br>
&lt;fantasai> schenney: in that case it's active<br>
&lt;fantasai> schenney: we can't expose what the browser's doing due to privacy concerns<br>
&lt;Rossen__> ack kbabbitt<br>
&lt;florian> q+<br>
&lt;Rossen__> ack khush<br>
&lt;Rossen__> ack fantasai<br>
&lt;fantasai> fantasai: :active currently is about click state in most cases, not about activation (though I wish it was)<br>
&lt;TabAtkins> scribe+ TabAtkins<br>
&lt;fantasai> fantasai: are we OK with this not being about click state for ::search-text?<br>
&lt;fantasai> fantasai: also, is it :active or is it :focus?<br>
&lt;fantasai> schenney: It's active in that it will be converted to selection when exiting search UI<br>
&lt;fantasai> schenney: but using new class name not used anywhere else<br>
&lt;fantasai> schenney: focus could maybe work<br>
&lt;fantasai> Rossen: I would stay away from :focus for accessibility reasons<br>
&lt;kbabbitt> +1 to staying away from focus for accessibility reasons<br>
&lt;fantasai> Rossen: :active is less problematic<br>
&lt;fantasai> Rossen: also assumes it's a singleton, not sure if this is true today<br>
&lt;TabAtkins> fantasai: "current" could work - we do have a :current pseudo<br>
&lt;fantasai> https://www.w3.org/TR/selectors-4/#time-pseudos<br>
&lt;TabAtkins> florian: what's it for?<br>
&lt;TabAtkins> fantasai: time-dimensional pseudoclasses<br>
&lt;TabAtkins> florian: If it doesn't conflict, reusing might be okay<br>
&lt;fantasai> florian: it's somewhat comparable<br>
&lt;fantasai> florian: there's a sort of time axis, but only wrt prev/next buttons<br>
&lt;florian> q?<br>
&lt;vmpstr> q+<br>
&lt;fantasai> florian: wrt one thing highlighted, that's an existing feature; but I don't think it's a problem<br>
&lt;fantasai> florian: there's a whole range of colors depending on window highlighted or not or one or many etc.<br>
&lt;Rossen__> ack florian<br>
&lt;fantasai> florian: I'm not sure it's doing anything not represented by the pseudos we're discussing<br>
&lt;fantasai> florian: but it's not just theoretical<br>
&lt;fantasai> vmpstr: Discussed Safari might not be able to implement, but if they did, changing color with backdrop change could affect things<br>
&lt;fantasai> florian: I don't think Safari is dimming the backdrop, it's applying a whole-page effect<br>
&lt;fantasai> florian: that's not representable by CSS on a highlight pseudo<br>
&lt;fantasai> florian: if we expect other browsers to do this, maybe it's the wrong approach<br>
&lt;smfr> q+<br>
&lt;Rossen__> ack vmpstr<br>
&lt;Rossen__> ack smfr<br>
&lt;fantasai> smfr: Unsure of reason to add new pseudos. Browser do different things, e.g. Safari does an overlay with punching hole through it for the result<br>
&lt;fantasai> smfr: justification to add new pseudos seems pretty weak<br>
&lt;fantasai> florian: There are some browsers that render this as something representable as in-page CSS<br>
&lt;fantasai> florian: author could restyle<br>
&lt;fantasai> s/could/could reasonably/<br>
&lt;fantasai> florian: but in other UAs could decide to not implement<br>
&lt;fantasai> schenney: the use case was pages that do e.g. code display/editing<br>
&lt;fantasai> schenney: being able to differentiate in-page search vs browser search<br>
&lt;fantasai> schenney: another use case was someone who didn't want people to cheat in their browser game by using in-page search, so could make invisible<br>
&lt;fantasai> fantasai: actually that was my concern, that pages would abuse to make find-in-page unusable. E.g. heavily advertised content that wants you to read through rather than find the thing you're looking for<br>
&lt;fantasai> smfr: [missed]<br>
&lt;fantasai> Rossen: Fragment navigation or whatever ...<br>
&lt;fantasai> smfr: scroll-to-text-fragment<br>
&lt;fantasai> Rossen: that gets navigated to, as far as I know it's the same mechanism<br>
&lt;fantasai> Rossen: not sure if UX is different?<br>
&lt;fantasai> schenney: in Chromium, the underlying rendering implementation would be the same<br>
&lt;florian> s/[missed]/like those annoying web pages that turn off context menus…]<br>
&lt;fantasai> schenney: shared system for painting, different frameworks for identifying the text<br>
&lt;fantasai> schenney: anti-pattern case is a good one<br>
&lt;fantasai> florian: 1. Do we do this? 2. If so, how?<br>
&lt;fantasai> florian: I haven't heard any arguments about the proposed syntax being wrong, but debate over whether to do it<br>
&lt;fantasai> florian: possibly we want to introduce some browser failsafe, like if contrast is bad can ignore autho styling<br>
&lt;fantasai> s/autho/author/<br>
&lt;fantasai> florian: if we have this feature, the proposed syntax is reasonable<br>
&lt;fantasai> POLL: Should we have this feature?<br>
&lt;fantasai> Rossen: Any objections to adopting this feature?<br>
&lt;fantasai> smfr: Not going to object, just neutral. Safari may not implement.<br>
&lt;astearns> I think it may be a minefield we’ll need to remove, but I won’t object<br>
&lt;fantasai> schenney: so we will call it ::search-text, and you may use ..? :current?<br>
&lt;fantasai> schenney: to distinguish which is the current focused one<br>
&lt;fantasai> smfr: wrt naming, thinking back to content-visiblity: hidden-find-matchable-thingy<br>
&lt;fantasai> smfr: doesn't that use the term 'find' and not 'search'?<br>
&lt;fantasai> vmpstr: That term does not appear in syntax, only in the spec<br>
&lt;fantasai> smfr: ok<br>
&lt;fantasai> PROPOSED: Add ::search-text, using :current to distinguish currently-focused match, mark as optional to implement<br>
&lt;fantasai> RESOLVED: Add ::search-text, using :current to distinguish currently-focused match, mark as optional to implement<br>
</details>


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


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

Received on Wednesday, 1 May 2024 23:49:39 UTC