Handle :visited/:link in RuleSet
Instead of having SelectorChecker::Match match the same selector twice, this CL proposes a way to deal with visited links via RuleSet. Whenever we add a rule to the RuleSet which contains :link or :visited, we effectively split the rule into two non-overlapping rules; one which applies to the regular style (kMatchLink) and one which applies to the visited style (kMatchVisited). The rules marked with kMatchVisited go in a separate list of visited dependent rules on the RuleSet. Then, when collecting matching rules, we try to match from this list only when kInsideVisitedLink. This way we can avoid paying any extra cost on every call to SelectorChecker::Match. Fixed: 1139464 Change-Id: I66f59acfbc0eb5e3225ab2b5be9ae572542bb8ce Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485062Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#818901}
Showing
This diff is collapsed.
Please register or sign in to comment