Add more precise tests for ::highlight() styles in the MPC.
For an MPC entry to match (when applying ::highlight() styles),
we'd test:
1. Inherited properties, including inherited variables,
match between the two parent styles.
2. Non-inherited properties must also match. (Sometimes, we test
this twice when there's explicit inheritance, which isn't
relevant for this issue.)
3. Highlight-specific properties, including inherited variables,
match between the originating element's styles.
However, this means that we test that InheritedVariables() must be
equal to two different styles (in #1 and #3), and if those sets
of variables differ, we can end up with an MPC entry that cannot
match anything. Yet, we insert it, and if combined with
custom highlights in universal selectors, we can end up with more
and more can-never-match-anything elements in the same bucket.
Thus, make proper testing for ::highlight() styles, where we test
only what needs to be tested, reducing the number of false positives.
There's a separate bug in step 3, which will be fixed in the next patch.
Bug: 461993670
Change-Id: I23d5edbd8a29917c2b8b9f59c96485c687d40355
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7172543
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1548375}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.