Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CheckPseudoHasFastRejectFilter to reject :has() argument checking
Use CheckPseudoHasFastRejectFilter before checking :has() argument selector to reject the argument checking early. To minimize the overhead of bloom filter allocation and element identifier hash collection, the bloom filter in CheckPseudoHasFastRejectFilter will not be allocated at the first :has() argument checking on a :has() anchor element. If there is only one :has() argument selector that checks the anchor element, the fast reject filter will not be used since the argument check is redundant if it cannot be rejected. The bloom filter will be allocated and element identifier hashes will be added to the filter at the second :has() argument checking on the same :has() anchor element. The created fast reject filter will be stored in CheckPseudoHasCacheScope to minimize the overhead of bloom filter allocation and element identifier cache collection. Once we used the fast reject filter for a :has() anchor element, mark the element as AffectedByMultipleHas so that we always create and use the fast reject filter for the :has() anchor element. There is a relatively small amount of regression on single :has() rule invalidation: - HasDescendantInvalidationWithoutNonMatchingHasRule.html https://pinpoint-dot-chromeperf.appspot.com/job/1662f8406a0000 3,465.147 -> 3,291.691 (-5.0%) But there is a significant performance enhancement on multiple non-matching :has() rule invalidation by avoiding unnecessary :has() argument selector checking: - HasDescendantInvalidationWith1NonMatchingHasRule.html https://pinpoint-dot-chromeperf.appspot.com/job/133b68286a0000 1,677.276 -> 2,649.180 (+57.9%) - HasDescendantInvalidationWithMultipleNonMatchingHasRules.html https://pinpoint-dot-chromeperf.appspot.com/job/13a515bfaa0000 545.203 -> 2,571.323 (+371.6%) Bug: 1341893 Change-Id: Icb99cbc6596f64ea585669ce543d612ec508a495 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3744327 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1033383}
- Loading branch information
Showing
14 changed files
with
826 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
248 changes: 190 additions & 58 deletions
248
third_party/blink/renderer/core/css/check_pseudo_has_argument_context_test.cc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.