summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html')
-rw-r--r--testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html b/testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html
new file mode 100644
index 0000000000..0435535552
--- /dev/null
+++ b/testing/web-platform/tests/css/css-layout-api/child-constraints/percentage-size-invalid.https.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#dom-layoutconstraintsoptions-percentageblocksize">
+<link rel="match" href="../green-square-ref.html">
+<meta name="assert" content="This test checks that setting an invalid percentage block-size of children works as expected." />
+
+<style>
+.test {
+ background: red;
+ width: 100px;
+}
+
+.child {
+ visibility: hidden;
+ width: 10px;
+ line-height: 0;
+
+ --percentage-block-size: -10;
+}
+
+.inline {
+ display: inline-block;
+ width: 10px;
+ height: 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 percentage shouldn't be resolved against an invalid percentageBlockSize. -->
+ <div class="child" style="--inline-size-expected: 10px; --block-size-expected: 10px; height: 100%;">
+ <div class="inline"></div>
+ </div>
+
+ <!-- A percentage shouldn't be resolved against an invalid percentageBlockSize. -->
+ <img class="child" style="--inline-size-expected: 10px; --block-size-expected: 0px; height: 100%;" />
+<script>
+importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-sizes-worklet.js'});
+</script>