summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html')
-rw-r--r--testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html b/testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html
new file mode 100644
index 0000000000..6e2bfb896b
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/container-queries/registered-color-style-queries.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>CSS Container Queries Test: registered color syntax style queries</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#style-container">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/cq-testcommon.js"></script>
+<style>
+ @property --reg-color {
+ syntax: "<color>";
+ inherits: false;
+ initial-value: red;
+ }
+
+ #light { color-scheme: light; }
+ #dark { color-scheme: dark; }
+ .container { --reg-color: light-dark(white, black); }
+
+ @container style(--reg-color: white) {
+ #t1 { color: green; }
+ }
+ @container style(--reg-color: black) {
+ #t2 { color: green; }
+ }
+</style>
+<div id="light" class="container">
+ <div id="t1"></div>
+</div>
+<div id="dark" class="container">
+ <div id="t2"></div>
+</div>
+<script>
+ const green = "rgb(0, 128, 0)";
+
+ test(() => {
+ assert_equals(getComputedStyle(t1).color, green);
+ }, "Registered color with light color-scheme and light-dark()");
+
+ test(() => {
+ assert_equals(getComputedStyle(t2).color, green);
+ }, "Registered color with dark color-scheme and light-dark()");
+</script>