Open delan opened 4 months ago
The CSS Working Group just discussed [selectors-4][css-pseudo-4] meaning of ::search-text:current(…), :past, :future
, and agreed to the following:
RESOLVED: :current() will never match ::search-text
We resolved that :current(…) will never match inside ::search-text, but there are still some unanswered questions:
Outside of highlight pseudos, is the list of compound selectors in :current(…) a <forgiving-selector-list>? On the one hand, selector lists are normally invalid when they contain an invalid selector, but on the other hand, “like ‘:is()’” suggests it should be forgiving. If so, we should also update this note.
Is ::search-text:current(…)
also an invalid selector, or just a selector that never matches? In other words, does a rule like a, ::search-text:current(b) {}
match a
? Per selectors #pseudo-element-states, pseudo combinations that are not explicitly allowed are invalid selectors, so we propose that this be an invalid selector.
What about :past and :future? We propose that these be invalid selectors under ::search-text.
We resolved that ::search-text (#3812) should have a :current (#10212) state for the active search result, but :current also has a functional form, where
:current(x, y)
matches any current element (or innermost ancestor) that also matchesx, y
, as well as the related pseudo-classes :past and :future.Is the list of compound selectors in :current(…) a <forgiving-selector-list>? On the one hand, selector lists are normally invalid when they contain an invalid selector, but on the other hand, “like ‘:is()’” suggests it should be forgiving. If so, we should also update this note.
What does
::search-text:current(x, y)
mean? Does it mean the innermostx
ory
that contains the active search result (which we probably want to forbid, since it would allow highlights to affect layout), or the ::search-text of that innermostx
ory
(which may have tricky :has()-like perf implications), or something else? We propose that::search-text:current(…)
be invalid, for now.What do
::search-text:past
and::search-text:future
mean? We propose that these also be invalid, for now, since no known UA distinguishes between search results on either “side” of :current.