-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@scope] Save MatchFlags in StyleScopeActivations
ComputedStyles that match pseudo-state-dependent selectors get a flag set for invalidation purposes. For example: p:hover { ... } When matching this selector against 'p', the MatchResults will contain MatchFlags with the kAffectedByHover flag set, regardless of whether or not 'p' is currently hovered or not. (The flag ultimately ends up on the ComputedStyle of 'p'). Now consider this @scope rule which selects the same element: @scope (p:hover) { :scope { ... } } Now we may or may not have a scoping root, depending on whether 'p' is hovered or not. When matching this selector (:scope) against 'p', we need to make sure that the kAffectedByHover is set in the returned MatchFlags, even if 'p' is not currently hovered (in which case we don't technically have a scoping root at 'p'). This means that we have to store the MatchFlags that was produced for for the scopes that were attempted activated. This is done in this CL by storing MatchFlags alongside the activation vector, and propagating these flags during handling of kScopeActivation. This may over-invalidate a little, since we're propagating the flags at the start of the compound that contains :scope (before actually evaluating :scope), but this is probably OK. Fixed: 1451091 Change-Id: Ia48664381766ef44e6ade11457e905f068b6103e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4790441 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1185140}
- Loading branch information
Showing
8 changed files
with
401 additions
and
26 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
Oops, something went wrong.