Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@scope] Support @scope (:host) #38610

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Feb 21, 2023

In CalculateActivations, we'd previously just call
Element.parentElement up the ancestor chain, therefore never
reach the host. Additionally, we did not propagate the original
SelectorCheckerContext.scope which is needed for :host to match.

This CL uses ParentOrShadowHostElement, and adds the concept of
"activation ceiling" to deal with the fact that we need to look at
one element above the current activation root when that root is a
ShadowRoot.

Note that :scope is supposed to be able to match "virtual" roots [1]
(like a ShadowRoot), but Blink does not support this in general.
This CL does not address this issue.

[1] w3c/csswg-drafts#7261

Bug: 1280240
Change-Id: I2d0be103f4cd02ec576711b959e075a5118e694a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4272396
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108363}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot changed the title [@scope] Support @scope(:host) [@scope] Support @scope (:host) Feb 22, 2023
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-4272396 branch 2 times, most recently from ccf83ea to 4f14b5c Compare February 22, 2023 14:49
In CalculateActivations, we'd previously just call
Element.parentElement up the ancestor chain, therefore never
reach the host. Additionally, we did not propagate the original
SelectorCheckerContext.scope which is needed for :host to match.

This CL uses ParentOrShadowHostElement, and adds the concept of
"activation ceiling" to deal with the fact that we need to look at
one element *above* the current activation root when that root is a
ShadowRoot.

Note that :scope is supposed to be able to match "virtual" roots [1]
(like a ShadowRoot), but Blink does not support this in general.
This CL does not address this issue.

[1] w3c/csswg-drafts#7261

Bug: 1280240
Change-Id: I2d0be103f4cd02ec576711b959e075a5118e694a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4272396
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108363}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants