Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-layout-api/intrinsic-sizes/invalid-min-max.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="match" href="invalid-ref.html">
<meta name="assert" content="This test checks that min-content-size greater than max-content-size is correctly clamped to max-content-size." />
<style>
.test {
background: red;
border: solid 2px;
height: 100px;
width: max-content;
}
@supports (display: layout(invalid-sizes)) {
.test {
display: layout(invalid-sizes);
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('invalid-sizes', class {
async intrinsicSizes() {
return { maxContentSize: 10, minContentSize: 200 };
}
async layout() {}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
</script>
</html>