-
Notifications
You must be signed in to change notification settings - Fork 674
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
[selectors-4] The behaviour of :scope in DocumentFragment or ShadowRoot #3016
Comments
No need to explicitly tag us in, we read all the issues anyway. Your first question is "nothing" - querySelector()'s argument is a scoped selector, which only matches descendants of the scoping element. For your second, it's defined in CSS Scoping - the shadow root is a virtual scoping root. The shadow root does have children - the elements of the shadow tree - so they're appropriately matched. If there are any top-level |
This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a
This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a
This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momon@google.com> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#583210}
This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momon@google.com> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#583210}
This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momon@google.com> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#583210}
…ees, a=testonly Automatic update from web-platform-testsAdd WPT for :scope selector on shadow trees This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momon@google.com> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#583210} -- wpt-commits: a48491848fb4e328e6cdd5c4d7a95494f1ff2c6a wpt-pr: 12252
…ees, a=testonly Automatic update from web-platform-testsAdd WPT for :scope selector on shadow trees This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momon@google.com> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#583210} -- wpt-commits: a48491848fb4e328e6cdd5c4d7a95494f1ff2c6a wpt-pr: 12252
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595}
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595}
When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595}
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 --HG-- extra : rebase_source : be9ef4d5292bb124600f98b101e98b78ca1b9ec0 extra : source : 5e307e2cc9a8b0e432882983637ae87feb65c0df
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Momoko Sumida <momon@google.com> Cr-Commit-Position: refs/heads/master@{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839
…ees, a=testonly Automatic update from web-platform-testsAdd WPT for :scope selector on shadow trees This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momongoogle.com> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Reviewed-by: Hayato Ito <hayatochromium.org> Cr-Commit-Position: refs/heads/master{#583210} -- wpt-commits: a48491848fb4e328e6cdd5c4d7a95494f1ff2c6a wpt-pr: 12252 UltraBlame original commit: 337b6f0c1dc4f4c6a3817b0b1fa478c8ade30566
…ees, a=testonly Automatic update from web-platform-testsAdd WPT for :scope selector on shadow trees This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momongoogle.com> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Reviewed-by: Hayato Ito <hayatochromium.org> Cr-Commit-Position: refs/heads/master{#583210} -- wpt-commits: a48491848fb4e328e6cdd5c4d7a95494f1ff2c6a wpt-pr: 12252 UltraBlame original commit: 337b6f0c1dc4f4c6a3817b0b1fa478c8ade30566
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 5e307e2cc9a8b0e432882983637ae87feb65c0df
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 40c8e72fa87d6667c83a6773373cd381f928d2f6
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 5e307e2cc9a8b0e432882983637ae87feb65c0df
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 40c8e72fa87d6667c83a6773373cd381f928d2f6
…ees, a=testonly Automatic update from web-platform-testsAdd WPT for :scope selector on shadow trees This WPT shows that :scope does not work for shadow root. :scope matches nothing when the direct child element or descendant of shadow root should be selected, while :scope works fine for descendant elements within shadow root. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Bug: 859692 Change-Id: I801706eb7891035dcb900588d5542bd48fa1c12a Reviewed-on: https://chromium-review.googlesource.com/1158445 Commit-Queue: Momoko Sumida <momongoogle.com> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Reviewed-by: Hayato Ito <hayatochromium.org> Cr-Commit-Position: refs/heads/master{#583210} -- wpt-commits: a48491848fb4e328e6cdd5c4d7a95494f1ff2c6a wpt-pr: 12252 UltraBlame original commit: 337b6f0c1dc4f4c6a3817b0b1fa478c8ade30566
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 5e307e2cc9a8b0e432882983637ae87feb65c0df
… of DocumentFragment/ShadowRoot, a=testonly Automatic update from web-platform-testsFix :scope selector matching in the case of DocumentFragment/ShadowRoot When used in querySelector and querySelectorAll, :scope should match the element or the DocumentFragment/ShadowRoot the querySelector is called on. However, WPT adeed in crrev.com/c/1158445 shows that :scope matches nothing when querySelector is called on shadow root, while it works fine when querySelector is called on true element. This CL fixes :scope selector matching process so that :scope itself matches DocumentFragment/ShadowRoot when querySelector is called on DocumentFragment/ShadowRoot. Tests for DocumentFragment are also added in this CL. Link to the spec: https://drafts.csswg.org/selectors-4/#the-scope-pseudo Link to related issue: w3c/csswg-drafts#3016 Link to related CL: crrev.com/c/1158445 Bug: 859692 Change-Id: If20fc4b122d93a553dc478be0ee958958340a34f Reviewed-on: https://chromium-review.googlesource.com/1203472 Reviewed-by: Rune Lillesveen <futharkchromium.org> Reviewed-by: Rakina Zata Amni <rakinachromium.org> Commit-Queue: Momoko Sumida <momongoogle.com> Cr-Commit-Position: refs/heads/master{#590595} -- wpt-commits: 40529833d147d79895ace6de923d126aae7631e8 wpt-pr: 12839 UltraBlame original commit: 40c8e72fa87d6667c83a6773373cd381f928d2f6
What should documentFragment.querySelector(":scope") return?
Since DocumentFragment is not an element, it cannot return DocumentFragment.
In the case of ShadowRoot, what should shadowRoot.querySelector(':scope > div') return?
Link to the spec section:
https://drafts.csswg.org/selectors-4/#scoping
cc @tabatkins @fantasai
The text was updated successfully, but these errors were encountered: