Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support
:host:has()
case to check whether a shadow host element has arelationship between its shadow root node and shadow tree element:
:host:has()
match? w3c/csswg-drafts#10693Normally,
:has()
checks relationship between its anchor element andthe other elements in the same tree.
But in
:host:has()
case,:has()
checks relationship in the shadowtree of the anchor element. For example,
:host(.a):has(> div)
matches a shadow host element if the host has
a
class value and theshadow root of the host has a child div element.
To cross tree boundary for testing selector and invalidating styles,
this CL adds 'HasArgumentMatchInShadowTree' flag to the CSSSelector and
sets the flag while parsing selectors.
SelectorChecker and CheckPseudoHasArgumentTraversalIterator cross tree
boundary for
:has()
argument test traversal if the flag is set.RuleInvalidationDataVisitor sets 'TreeBoundaryCrossing
invalidation-set flag for non-subject
:has()` if the flag is set.If StyleEngine reaches to a shadow host element while performing
:has()
invalidation, it invalidates the host element if the host is affected by
:has()
state change.Bug: 359758910
Change-Id: I69f0813deca4caefcff1f0b5ff8181ba67967a40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839398
Commit-Queue: Byungwoo Lee <blee@igalia.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1362877}