Highlight pseudos use the forced-color status of their originating element #34223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the resolution in [1], forced-color-adjust should not be one of the
supported properties [2] in highlight pseudos, and the forced-color
state of highlights should be taken from the originating element. This
change updates the HighlightInheritance implementation to match the
resolution.
There are a few parts to this:
longer a valid property for highlight pseudos. But, since shipping
this change for ::selection may cause compatibility issues, we
introduce a new valid_for_highlight_legacy parameter that maintains
the old behavior and we update valid_for_highlight, which will be used
only for highlights with the new inheritance model enabled, to use the
new behavior.
using any filter at all for ::highlight(), ::spelling-error, and
::grammar-error. This is now fixed.
status from the originating element to the corresponding highlight
pseudo.
The new test is disabled on Mac/Linux due to some small differences
in text decoration painting between those from highlight pseudos
and from non-highlight rules, unrelated to the contents of this change.
[1] w3c/csswg-drafts#7264 (comment)
[2] https://drafts.csswg.org/css-pseudo-4/#highlight-styling
Bug: 1309835, 1024156
Change-Id: I732afd24bbba2619a6718270faa0a1d2fcb98512
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3665644
Reviewed-by: Rune Lillesveen <[email protected]>
Reviewed-by: Delan Azabani <[email protected]>
Commit-Queue: Dan Clark <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1009639}