Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class=reftest-wait>
<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>