aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html')
-rw-r--r--tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html b/tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html
new file mode 100644
index 00000000000..4e912ed9f2a
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-layout-api/auto-block-size-negative.https.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#interaction-sizing">
+<link rel="match" href="auto-block-size-negative-ref.html">
+<meta name="assert" content="This test checks that auto-block-size is correctly clamped to zero." />
+<meta name="assert" content="TODO" />
+
+<style>
+
+.test {
+ background: red;
+ border: solid 2px;
+ margin: 20px 0;
+}
+
+.width-100 {
+ width: 100px;
+ writing-mode: horizontal-tb;
+}
+
+.height-100 {
+ height: 100px;
+ writing-mode: vertical-rl;
+}
+
+@supports (display: layout(block-size-negative)) {
+ .test {
+ display: layout(block-size-negative);
+ background: green;
+ }
+}
+</style>
+<script src="/common/reftest-wait.js"></script>
+<script src="/common/worklet-reftest.js"></script>
+
+<div class="test width-100"></div>
+<div class="test height-100"></div>
+
+<script id="code" type="text/worklet">
+registerLayout('block-size-negative', class {
+ *intrinsicSizes() {}
+ *layout() {
+ return {autoBlockSize: -100};
+ }
+});
+</script>
+
+<script>
+importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
+</script>
+</html>