summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-contain/container-queries/grid-item-container.html
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/container-queries/grid-item-container.html
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/container-queries/grid-item-container.html')
-rw-r--r--testing/web-platform/tests/css/css-contain/container-queries/grid-item-container.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-contain/container-queries/grid-item-container.html b/testing/web-platform/tests/css/css-contain/container-queries/grid-item-container.html
new file mode 100644
index 0000000000..f1c66efc26
--- /dev/null
+++ b/testing/web-platform/tests/css/css-contain/container-queries/grid-item-container.html
@@ -0,0 +1,38 @@
+<!doctype html>
+<title>CSS Container Queries Test: Grid item container</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#size-container">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support/cq-testcommon.js"></script>
+<style>
+ #grid {
+ width: 300px;
+ display: grid;
+ grid-template-columns: 2fr 1fr;
+ }
+ .item {
+ container-type: inline-size;
+ }
+ @container (width > 50px) {
+ .item div { color: lime; }
+ }
+ @container (width > 150px) {
+ .item div { color: green; }
+ }
+</style>
+<div id="grid">
+ <div class="item">
+ <div id="target1"></div>
+ </div>
+ <div class="item">
+ <div id="target2"></div>
+ </div>
+</div>
+<script>
+ setup(() => assert_implements_container_queries());
+
+ test(() => {
+ assert_equals(getComputedStyle(target1).color, "rgb(0, 128, 0)", "First item container should be 200px wide");
+ assert_equals(getComputedStyle(target2).color, "rgb(0, 255, 0)", "Second item container should be 100px wide");
+ }, "Check that children can query grid item containers");
+</script>