You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#10212 resolved that ::search-text (#3812) will be a single highlight pseudo with two states, which currently implies a single highlight overlay (css-pseudo #highlight-bounds).
But while working on the ::search-text paint impl in Chromium, we found that splitting :current and :not(:current) into separate highlight overlays for paint makes the impl a lot less complicated. With a single overlay, the highlight overlay code needs to explicitly track where ::search-text was :current, so we can store and switch between two sets of computed and resolved styles for ::search-text (and ::selection). With two overlays, it’s all encoded in which overlay we choose.
We propose allowing impls to paint ::search-text:current and ::search-text:not(:current) in separate highlight overlays. This would have minor painting order side effects, like backgrounds of :current overlapping text shadows of :not(:current), but the rendering would otherwise be roughly the same.
If this proposal is considered infeasible, one alternative would be to reverse our resolution in #10212 and split ::search-text back into two highlight pseudos.
The text was updated successfully, but these errors were encountered:
This patch paints find-in-page markers as ::search-text highlights
instead of non-CSS markers, when the Blink feature is enabled.
To simplify the impl, we create a separate highlight overlay for
::search-text:current and paint it after ::search-text:not(:current).
The spec issue to allow this is pending resolution:
w3c/csswg-drafts#10527
Bug: 339298411
Change-Id: I6f0d67726dc70fa2111bbc83d63e21cd77bbbe14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5541338
Reviewed-by: Philip Rogers <[email protected]>
Commit-Queue: Rob Buis <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1358531}
#10212 resolved that ::search-text (#3812) will be a single highlight pseudo with two states, which currently implies a single highlight overlay (css-pseudo #highlight-bounds).
But while working on the ::search-text paint impl in Chromium, we found that splitting :current and :not(:current) into separate highlight overlays for paint makes the impl a lot less complicated. With a single overlay, the highlight overlay code needs to explicitly track where ::search-text was :current, so we can store and switch between two sets of computed and resolved styles for ::search-text (and ::selection). With two overlays, it’s all encoded in which overlay we choose.
We propose allowing impls to paint ::search-text:current and ::search-text:not(:current) in separate highlight overlays. This would have minor painting order side effects, like backgrounds of :current overlapping text shadows of :not(:current), but the rendering would otherwise be roughly the same.
If this proposal is considered infeasible, one alternative would be to reverse our resolution in #10212 and split ::search-text back into two highlight pseudos.
The text was updated successfully, but these errors were encountered: