-
Notifications
You must be signed in to change notification settings - Fork 35
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
Current scoping root used when matching "selector_matches" doesn't work well for shadow tree links #240
Comments
Hrm, interesting. It's always been a little awkward because it seems clearly useful to encompass shadow DOM, and yet CSS selectors generally don't pierce that boundary.
I suspect your resolution is correct, but wouldn't mind a second opinion from DOM folks if you haven't already asked. |
AFAICT, the only difference is that (From https://drafts.csswg.org/selectors-4/#the-scope-pseudo: "If there is no scoping root then :scope represents the root of the document (equivalent to :root)") |
See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb
See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Adithya Srinivasan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1228203}
See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Adithya Srinivasan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1228203}
See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Adithya Srinivasan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1228203}
…root, a=testonly Automatic update from web-platform-tests DocumentRules: Use tree root as scoping root See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Adithya Srinivasan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1228203} -- wpt-commits: 7b64f598ab50ac42f769678ba1e9a5d56766645c wpt-pr: 43312
…root, a=testonly Automatic update from web-platform-tests DocumentRules: Use tree root as scoping root See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <[email protected]> Commit-Queue: Adithya Srinivasan <[email protected]> Cr-Commit-Position: refs/heads/main@{#1228203} -- wpt-commits: 7b64f598ab50ac42f769678ba1e9a5d56766645c wpt-pr: 43312
…root, a=testonly Automatic update from web-platform-tests DocumentRules: Use tree root as scoping root See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <jbromanchromium.org> Commit-Queue: Adithya Srinivasan <adithyaschromium.org> Cr-Commit-Position: refs/heads/main{#1228203} -- wpt-commits: 7b64f598ab50ac42f769678ba1e9a5d56766645c wpt-pr: 43312 UltraBlame original commit: 1d0db6e7294f9eb89a4e512a3f26a95a884d3475
…root, a=testonly Automatic update from web-platform-tests DocumentRules: Use tree root as scoping root See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <jbromanchromium.org> Commit-Queue: Adithya Srinivasan <adithyaschromium.org> Cr-Commit-Position: refs/heads/main{#1228203} -- wpt-commits: 7b64f598ab50ac42f769678ba1e9a5d56766645c wpt-pr: 43312 UltraBlame original commit: 1d0db6e7294f9eb89a4e512a3f26a95a884d3475
…root, a=testonly Automatic update from web-platform-tests DocumentRules: Use tree root as scoping root See WICG/nav-speculation#240. Using TreeRoot() as the scoping root allows links inside shadow trees to be matched. Bug: 1371522 Change-Id: If830a8d4883bf9c8a769a74915f6a57a3eaa01eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054502 Reviewed-by: Jeremy Roman <jbromanchromium.org> Commit-Queue: Adithya Srinivasan <adithyaschromium.org> Cr-Commit-Position: refs/heads/main{#1228203} -- wpt-commits: 7b64f598ab50ac42f769678ba1e9a5d56766645c wpt-pr: 43312 UltraBlame original commit: 1d0db6e7294f9eb89a4e512a3f26a95a884d3475
Currently, when matching a selector against a link while processing document rule CSS selector predicates, we use the link's document as a scoping root. This would mean that elements inside other tree scopes (including shadow trees attached to the document) would always be excluded when matching these selectors and would never match.
(From spec, "When a selector is scoped, it matches an element only if the element is a descendant of the scoping root.").
I think we should be using the link's root as the scoping root instead. So for links inside a shadow tree, we would use the shadow root as the scoping root.
The text was updated successfully, but these errors were encountered: