diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html')
-rw-r--r-- | testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html b/testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html new file mode 100644 index 0000000000..a498c4a7e6 --- /dev/null +++ b/testing/web-platform/tests/css/css-contain/container-queries/at-container-style-serialization.html @@ -0,0 +1,34 @@ +<!doctype html> +<title>CSS Container Queries: style() conditionText serialization</title> +<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-queries"> +<link rel="help" href="https://drafts.csswg.org/cssom/#serialize-a-css-rule"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/cq-testcommon.js"></script> +<style id="testSheet"> + @container style( --foo:bar) { } + @container STyle(--foo: ) { } + @container STyle(--foo:) { } + @container STyle(--foo) { } + @container style( ( --FOO: BAR) OR ( prop: val ) ) { } + @container style (--foo: bar) { } +</style> +<script> + setup(() => { + assert_implements_container_queries(); + assert_equals(testSheet.sheet.cssRules.length, 6); + }); + + const tests = [ + ["style(--foo: bar)", "Normalize spaces"], + ["style(--foo: )", "Empty declaration value - spaces"], + ["style(--foo: )", "Empty declaration value"], + ["STyle(--foo)", "Missing declaration value"], + ["style((--FOO: BAR) or ( prop: val ))", "Unknown CSS property after 'or'"], + ["(--foo: bar)", "Not a style function with space before '('"] + ].map((e, i) => [testSheet.sheet.cssRules[i], ...e]); + + tests.forEach((t) => { + test(() => assert_equals(t[0].conditionText, t[1]), t[2]); + }); +</script> |