summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html')
-rw-r--r--testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html b/testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html
new file mode 100644
index 0000000000..eb104a180d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-layout-api/child-constraints/available-size-for-percentages-htb-vrl.https.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableinlinesize">
+<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-availableblocksize">
+<link rel="match" href="../green-square-ref.html">
+<meta name="assert" content="This test checks that resolving percentages against the available size works as expected." />
+
+<style>
+.test {
+ writing-mode: horizontal-tb;
+ background: red;
+ width: 100px;
+}
+
+.child {
+ writing-mode: vertical-rl;
+ visibility: hidden;
+
+ --available-inline-size: 50;
+ --available-block-size: 20;
+
+ --inline-size-expected: 10px;
+ --block-size-expected: 10px;
+}
+
+@supports (display: layout(test)) {
+ .test {
+ background: green;
+ display: layout(test);
+ }
+}
+</style>
+<script src="/common/reftest-wait.js"></script>
+<script src="/common/worklet-reftest.js"></script>
+
+<div class="test">
+ <!-- A fixed width/height shouldn't be affected by the available size. -->
+ <div class="child" style="width: 10px; height: 10px;"></div>
+
+ <!-- A percentage width/height should resolve itself against the available size. -->
+ <div class="child" style="width: 20%; height: 50%;"></div>
+
+ <!-- A percentage max-width/max-height should resolve itself against the available size. -->
+ <div class="child" style="width: 15px; max-width: 20%; height: 15px; max-height: 50%;"></div>
+
+ <!-- A percentage min-width/min-height should resolve itself against the available size. -->
+ <div class="child" style="width: 5px; min-width: 20%; height: 5px; min-height: 50%;"></div>
+
+ <!-- A replaced percentage width/height should resolve itself against the available size. -->
+ <img class="child" style="width: 20%; height: 50%;" />
+
+ <!-- A replaced percentage max-width/max-height should resolve itself against the available size. -->
+ <img class="child" style="width: 15px; max-width: 20%; height: 15px; max-height: 50%;" />
+
+ <!-- A replaced percentage min-width/min-height should resolve itself against the available size. -->
+ <img class="child" style="width: 5px; min-width: 20%; height: 5px; min-height: 50%;" />
+<script>
+importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'});
+</script>