-
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] Consider disallowing :scope inside :has() #7211
Comments
Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10
Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038}
Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038}
Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038}
… classes inside :has(), a=testonly Automatic update from web-platform-tests Support invalidation for location pseudo classes inside :has() Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038} -- wpt-commits: 4b68c346624989cf904a632a862fd54520adb1fc wpt-pr: 34051
The issue #6952 seems to converge in the opinion of disallowing nested Based on it, I think it would be desirable to clarify these three issues that are related to each other.
I think that the key point is to resolve the ambiguity between the implicit There can be two options. Option 1: Accept #7211 (Disallow explicit It looks simple and clear way to remove the ambiguity. We don't need to think about how the The only downside is that we cannot use explicit Option 2: Accept #6399 (Remove The only advantage is that we can use In this case, to avoid some misunderstanding, we need to clarify that the absolutizing relative-selector doesn't related to the About the risk of this option, I don't have any case right now, but I'm not sure that it will not make any tricky issues. Desired resolution In my opinion, Option 1 looks better because it is simple and it only limit some rare usages. Alternative If the Option 2 is accepted, we need to consider #7212 (disallowing With the Option 2, the explicit Based on this, we can think about
If both not accepted
|
… classes inside :has(), a=testonly Automatic update from web-platform-tests Support invalidation for location pseudo classes inside :has() Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038} -- wpt-commits: 4b68c346624989cf904a632a862fd54520adb1fc wpt-pr: 34051
This is a duplicate of #6399, which resolved to remove the special |
Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b
Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688773 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1010508}
Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688773 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1010508}
Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688773 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1010508}
…licit :scope in :has(), a=testonly Automatic update from web-platform-tests Remove 'tentative' from wpt test for explicit :scope in :has() Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688773 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1010508} -- wpt-commits: 687d49f633cc46184dd2fcc18a34c04a15d0654c wpt-pr: 34298
Support invalidation for :link, :any-link and :target pseudo class inside :has(). Invalidation for :visited inside :has() is not needed since :visited is not matched inside :has() to prevent leaking visitedness. Ignored invalidation of :scope inside :has() due to an issue in the csswg-draft. - w3c/csswg-drafts#7211 Bug: 669058, 1324834 Change-Id: Ice42f0113f0cdc69a8054c2778c9cab3cdd5ef10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645177 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Byungwoo Lee <blee@igalia.com> Cr-Commit-Position: refs/heads/main@{#1003038} NOKEYCHECK=True GitOrigin-RevId: 1d9eb9e8bb664b1f3117b788f1ab48bcc89648ee
Remove 'tentative' from has-argument-with-explicit-scope.tentative.html according to the issue resolution: - w3c/csswg-drafts#6399 - w3c/csswg-drafts#7211 Bug: 669058 Change-Id: Iae1946abfb4a5739e95f0b7d90869b6088f87b5b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688773 Commit-Queue: Byungwoo Lee <blee@igalia.com> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1010508} NOKEYCHECK=True GitOrigin-RevId: 496f1a66e6f1f1d4af5f67839fcb94eda6f517cb
:scope
inside:has()
is related to these two issues::scope
dependency from the relative selectors definition (issue 6399):has()
(issue 6952)According to the current definition of absolutizing a relative selector using
:scope
, these 3 selectors are identical..b:has(.a :scope .c)
.b:has(:is(.a :scope) .c)
.a .b:has(.c)
As pointed at the previous issues (issue 6399, issue 6952),
:is()
inside:has()
increases invalidation complexity,:scope
inside:has()
creates exactly same problem that:is()
inside:has()
creates,:scope
inside:has()
because there can be much simpler expression.So, it would be better not to use
:scope
inside:has()
when we follow the current spec of absolutizing relative selectors.Even if we follow the suggestion of (issue 6399),
:scope
inside:has()
will work only when we use it in the snapshot profile.:scope
inside:has()
will not match any element because any subject element of:has()
pseudo class cannot have the root as its descendant or next sibling. (The only possible way is to use:scope
with:is()
like.a:has(~ :is(:scope > .b) .c)
)In the snapshot profile,
:scope
inside subject:has()
will not match any element when we callquerySelector()
,querySelectorAll()
,matches()
because the:scope
element of the node selector API method call cannot be a descendant or next sibling of the:scope
element itself or its descendants. Same with above, the only possible way is to use it with:is()
.So, if
:is()
is disallowed inside:has()
, the:scope
inside:has()
will work only in these usages, but I'm not sure that this is useful in practice.closest()
with a selector using:scope
inside subject:has()
element.closest(".a:has(:scope ~ .b)")
:scope
inside non-subject:has()
element.querySelectorAll(".a:has(:scope ~ .b) .c")
element.querySelector(".a:has(:scope ~ .b) .c")
element.matches(".a:has(:scope ~ .b) .c")
element.closest(".a:has(:scope ~ .b) .c")
How about avoiding this confusion by disallowing
:scope
inside:has()
?The text was updated successfully, but these errors were encountered: