CSS highlight pseudos: resolve styles for ::search-text
This patch resolves the styles for ::search-text twice during element
style recalc (once for :current, once for :not(:current)), and once
for :not(:current) only during getComputedStyle [1].
We use StyleRequest::SearchTextRequest to tell the resolver which
state we want styles for, which then gets plumbed to the selector
checker via ElementRuleCollector, ContextWithStyleScopeFrame, and
SelectorCheckingContext.
SelectorChecker then uses that request to decide whether a selector
with :current is a match, but only when the last dynamic pseudo was
::search-text (using a SelectorCheckingContext flag, like we do for
::selection:window-inactive).
Bug: 339298411
Change-Id: Id8cb1cc14399318a18d305f54b64b686a5c6d60a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5528894
Reviewed-by: Anders Hartvoll Ruud andruud@chromium.org
Commit-Queue: Delan Azabani dazabani@igalia.com
Cr-Commit-Position: refs/heads/main@{#1301073}