Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@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: 1. For matching the :scope pseudo-class. 2. 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}
- Loading branch information