merge_pr_49312
[@scope] Pass TreeScope separately to SelectorChecker
The scope
member of SelectorCheckingContext is currently used
for several closely related (but different) things, causing subtle
bugs and a hard-to-understand model.
To address this, pass the TreeScope to SelectorChecker separately,
and use context.tree_scope for ShadowRoot-dependent decisions
in selector matching.
The context.scope
field is now only used for two things:
- For matching the :scope pseudo-class.
- For creating the default activation for @scope.
This fixes Issue 377647716, because since we no longer "clobber"
context.scope during scope activation, making ParentElement
traverse to the shadow host.
Fixed: 377647716
Change-Id: I833f1dfb03c092927712bc6fd649a414a45ac7a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6035173
Reviewed-by: Rune Lillesveen [email protected]
Commit-Queue: Anders Hartvoll Ruud [email protected]
Cr-Commit-Position: refs/heads/main@{#1386249}