blob: 3a6665d8aa525e2ed61ab0987f22df8a8a94a55f [file] [log] [blame]
<!DOCTYPE html>
<html class=reftest-wait>
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#invoke-an-intrinsic-sizes-callback">
<link rel="match" href="fallback-ref.html">
<meta name="assert" content="This test checks that a layout() class with a throwing intrinsicSizes function will fallback to block layout." />
<style>
.test {
background: red;
border: solid 2px;
width: min-content;
}
.float {
float: left;
height: 100px;
width: 50%;
}
.fc {
display: flow-root;
height: 100px;
}
@supports (display: layout(throwing-intrinsic-sizes)) {
.test {
display: layout(throwing-intrinsic-sizes);
background: green;
}
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<div class="test">
<div class="float"></div>
<div class="fc"></div>
</div>
<script id="code" type="text/worklet">
registerLayout('throwing-intrinsic-sizes', class {
async intrinsicSizes() { throw Error('fail!'); }
async layout() {}
});
</script>
<script>
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
</script>
</html>