Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DocumentRules: Implement matching for selector_matches
This CL integrates document speculation rules with the style engine for style invalidation. The general flow is as follows: 1) DocumentSpeculationRules notifies StyleEngine when a new SpeculationRuleSet is added/removed, and provides a list of selectors from all the selector_matches predicates 2) StyleEngine updates the global RuleSet with these selectors, these are now taken into account when building InvalidationSets 3) When style is computed for a link in UpdateStyle, it is matched against all of the selectors from speculation rules, and a list of matching selectors is stored in ComputedStyle 4) If the list of matching selectors for a list changes, DocumentSpeculationRules is notified (and the link is invalidated and UpdateSpeculationCandidates is queued) 5) When actually matching links against a CSSSelectorPredicate, we check to see if the ComputedStyle for the link has the selector in the matching list (it matches iff it is in the list) This CL has two major issues that will be addressed in follow-ups: 1) UpdateSpeculationCandidates can currently be called when style isn't clean (so ComputedStyle is not up-to-date); this is a problem only when there exists at least one selector_matches predicate 2) display:none links will not have a ComputedStyle set after UpdateStyle (which currently means matching against them with a selector_matches predicate always returns false) Bug: 1371522 Change-Id: I5629ea24a2047acf452ca9b68b252162a929fca0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4156272 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Adithya Srinivasan <adithyas@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/main@{#1097380}
- Loading branch information
Showing
19 changed files
with
625 additions
and
23 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
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
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
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
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.