blob: c614a2fb12f4a545064738491bfe437601af7b82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#interaction-sizing">
<link rel="match" href="negative-ref.html">
<meta name="assert" content="This test checks that min-content-size is correctly clamped to zero." />
<style>
.test {
background: red;
border: solid 2px;
height: 100px;
width: min-content;
}
@supports (display: layout(min-content-size-negative)) {
.test {
display: layout(min-content-size-negative);
background: green;
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test"></div>
<script id="code" type="text/worklet">
registerLayout('min-content-size-negative', class {
async intrinsicSizes() {
return { minContentSize: -100 };
}
async layout() {}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
</script>
</html>
|