summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/parsing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-contain/parsing
parentInitial commit. (diff)
downloadfirefox-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/parsing')
-rw-r--r--testing/web-platform/tests/css/css-contain/parsing/contain-computed-children.html17
-rw-r--r--testing/web-platform/tests/css/css-contain/parsing/contain-computed.html33
-rw-r--r--testing/web-platform/tests/css/css-contain/parsing/contain-invalid.html30
-rw-r--r--testing/web-platform/tests/css/css-contain/parsing/contain-valid.html32
4 files changed, 112 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-contain/parsing/contain-computed-children.html b/testing/web-platform/tests/css/css-contain/parsing/contain-computed-children.html
new file mode 100644
index 0000000000..b955bed76c
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/parsing/contain-computed-children.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>CSS Containment Module Level 1: getComputedStyle().contain</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain/#contain-property">
+<meta name="assert" content="computed contain value for children should ignore container contain value.">
+<div id="container"><div id="target"></div></div>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+test(() => {
+ ['none', 'style', 'layout', 'paint', 'size', 'strict', 'content'].forEach(value => {
+ container.style.contain = value;
+ assert_equals(getComputedStyle(target).contain, "none");
+ });
+}, "computed contain value for children should ignore container contain value");
+</script>
diff --git a/testing/web-platform/tests/css/css-contain/parsing/contain-computed.html b/testing/web-platform/tests/css/css-contain/parsing/contain-computed.html
new file mode 100644
index 0000000000..02633953c5
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/parsing/contain-computed.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Containment Module Level 3: getComputedStyle().contain</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#contain-property">
+<meta name="assert" content="contain computed value is as specified.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value("contain", "none");
+test_computed_value("contain", "strict");
+test_computed_value("contain", "content");
+
+test_computed_value("contain", "size");
+test_computed_value("contain", "layout");
+test_computed_value("contain", "style");
+test_computed_value("contain", "paint");
+test_computed_value("contain", "size layout");
+test_computed_value("contain", "style paint");
+test_computed_value("contain", "style layout paint", "content");
+test_computed_value("contain", "size style layout paint", "strict");
+test_computed_value("contain", "size layout paint", "size layout paint");
+test_computed_value("contain", "layout paint");
+test_computed_value("contain", "inline-size");
+test_computed_value("contain", "inline-size layout style paint");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-contain/parsing/contain-invalid.html b/testing/web-platform/tests/css/css-contain/parsing/contain-invalid.html
new file mode 100644
index 0000000000..9f96bbc2fe
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/parsing/contain-invalid.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Containment Module Level 3: parsing contain with invalid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#contain-property">
+<meta name="assert" content="contain supports only the grammar 'none | strict | content | [ [ size | inline-size ] || layout || style || paint ]'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_invalid_value("contain", "auto");
+test_invalid_value("contain", "layout layout");
+test_invalid_value("contain", "strict layout");
+test_invalid_value("contain", "paint strict");
+test_invalid_value("contain", "paint layout style paint");
+test_invalid_value("contain", "none none");
+test_invalid_value("contain", "none strict");
+test_invalid_value("contain", "strict strict");
+test_invalid_value("contain", "strict none");
+test_invalid_value("contain", "strict content");
+test_invalid_value("contain", "size layout size");
+test_invalid_value("contain", "paint content");
+test_invalid_value("contain", "size inline-size");
+test_invalid_value("contain", "inline-size inline-size");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-contain/parsing/contain-valid.html b/testing/web-platform/tests/css/css-contain/parsing/contain-valid.html
new file mode 100644
index 0000000000..f7e18411da
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/parsing/contain-valid.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Containment Module Level 3: parsing contain with valid values</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#contain-property">
+<meta name="assert" content="contain supports the full grammar 'none | strict | content | [ [ size | inline-size ] || layout || style || paint ]'.">
+<meta name="assert" content="contain serializes in canonical order.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_valid_value("contain", "none");
+test_valid_value("contain", "strict");
+test_valid_value("contain", "content");
+
+// [ [ size | inline-size ] || layout || style || paint ]
+test_valid_value("contain", "size");
+test_valid_value("contain", "layout");
+test_valid_value("contain", "style");
+test_valid_value("contain", "paint");
+test_valid_value("contain", "layout size", "size layout");
+test_valid_value("contain", "paint style", "style paint");
+test_valid_value("contain", "layout style paint");
+test_valid_value("contain", "layout paint style size", "size layout style paint");
+test_valid_value("contain", "inline-size");
+test_valid_value("contain", "layout inline-size", "inline-size layout");
+</script>
+</body>
+</html>