Bug
1848612 [wpt PR 41440] - [@scope] Scope to host element if there's no owner-parent element, a=testonly
Automatic update from web-platform-tests
[@scope] Scope to host element if there's no owner-parent element
Implicit scopes, i.e. scopes without a <scope-start> selector,
should scope to the parent element of the owner element:
<div id=foo>
<style>
@scope { ... } /* Scoped to #foo */
</style>
</div>
However, there are two ShadowDOM-related cases where we don't have
an owner-parent element:
1. When the <style> element appears directly below a shadow root.
2. When the stylesheet is constructed/adopted. In this case we don't
even have an owner element.
Currently, we handle this by never activating the scope.
This CL fixes this issue by instead scoping implicit @scope rules
to the shadow *host* instead of the *root*. This requires a spec
change [1], therefore the tests are marked as tentative.
Fixed:
1379844
[1] https://github.com/w3c/csswg-drafts/issues/9178
Change-Id: I9146ffb3c6cb5e2f5697dc3d3e62cda9396709b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
4778499
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#
1184653}
--
wpt-commits:
21cc51826719698a688a92e7a48c8775a5329c20
wpt-pr: 41440