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

[selectors-4] The behaviour of :scope in DocumentFragment or ShadowRoot #3016

Closed
momomon opened this issue Aug 14, 2018 · 1 comment
Closed

Comments

@momomon
Copy link

momomon commented Aug 14, 2018

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

@tabatkins
Copy link
Member

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 divs in the shadow tree, they'll be returned by that query.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 15, 2018
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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 15, 2018
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
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 15, 2018
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 15, 2018
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 15, 2018
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 16, 2018
…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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Aug 17, 2018
…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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 5, 2018
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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 5, 2018
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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 7, 2018
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
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 10, 2018
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
aarongable pushed a commit to chromium/chromium that referenced this issue Sep 12, 2018
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 12, 2018
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 12, 2018
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 14, 2018
… 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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Sep 15, 2018
… 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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 15, 2018
… 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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this issue Sep 15, 2018
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants