From 6a59115a05603b12f20d40e7478e98ca0df1636a Mon Sep 17 00:00:00 2001 From: Anders Hartvoll Ruud Date: Mon, 16 Jan 2023 14:26:14 +0000 Subject: [PATCH] Bug 1810093 [wpt PR 37926] - [@scope] Support implicit scoping roots, a=testonly Automatic update from web-platform-tests [@scope] Support implicit scoping roots This CL makes it possible to specify a @scope rule without any prelude, scoping the rules implicitly to the parent of the owner node. This is implemented by storing a StyleSheetContents in each StyleScope, and treating each owner-parent-node of the StyleSheetContents as a scoping root. The following likely doesn't work, and is postponed for future CLs: - Constructed stylesheets - An owner node whose parent node is a ShadowRoot https://github.com/w3c/csswg-drafts/issues/7349 Bug: 1379844 Change-Id: Icbfae88636662e9a16dd11f9c7a371c997447f60 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4161741 Reviewed-by: Rune Lillesveen Commit-Queue: Anders Hartvoll Ruud Cr-Commit-Position: refs/heads/main@{#1093015} -- wpt-commits: 88acd4d4af38934ec6f035cb214c51aeb5b346d5 wpt-pr: 37926 --- .../tests/css/css-cascade/resources/scope.css | 4 + .../css-cascade/scope-implicit-external.html | 30 ++++++ .../tests/css/css-cascade/scope-implicit.html | 91 +++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 testing/web-platform/tests/css/css-cascade/resources/scope.css create mode 100644 testing/web-platform/tests/css/css-cascade/scope-implicit-external.html create mode 100644 testing/web-platform/tests/css/css-cascade/scope-implicit.html diff --git a/testing/web-platform/tests/css/css-cascade/resources/scope.css b/testing/web-platform/tests/css/css-cascade/resources/scope.css new file mode 100644 index 0000000000000..780e90fb67b99 --- /dev/null +++ b/testing/web-platform/tests/css/css-cascade/resources/scope.css @@ -0,0 +1,4 @@ +@scope { + :scope { z-index:1; } + .a { z-index:2; } +} diff --git a/testing/web-platform/tests/css/css-cascade/scope-implicit-external.html b/testing/web-platform/tests/css/css-cascade/scope-implicit-external.html new file mode 100644 index 0000000000000..d1ac738b778da --- /dev/null +++ b/testing/web-platform/tests/css/css-cascade/scope-implicit-external.html @@ -0,0 +1,30 @@ + + + + @scope - implicit scope root (external sheet) + + + + + +
+
+ +
+
+
+ + + + diff --git a/testing/web-platform/tests/css/css-cascade/scope-implicit.html b/testing/web-platform/tests/css/css-cascade/scope-implicit.html new file mode 100644 index 0000000000000..805a91eba3675 --- /dev/null +++ b/testing/web-platform/tests/css/css-cascade/scope-implicit.html @@ -0,0 +1,91 @@ + +@scope - implicit scope root + + + +
+ + + + + + + + +