Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-pseudo] allowing ::search-text:current its own overlay #10527

Open
delan opened this issue Jul 4, 2024 · 0 comments
Open

[css-pseudo] allowing ::search-text:current its own overlay #10527

delan opened this issue Jul 4, 2024 · 0 comments

Comments

@delan
Copy link
Contributor

delan commented Jul 4, 2024

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant