flex.https.html (1428B)
1 <!DOCTYPE html> 2 <html class=reftest-wait> 3 <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#interaction-sizing"> 4 <link rel="match" href="flex-ref.html"> 5 <meta name="assert" content="This test checks that the flex layout respects the auto-block-size." /> 6 7 <style> 8 .flex { 9 width: 300px; 10 display: flex; 11 border: solid 2px; 12 } 13 14 .custom { 15 background: red; 16 box-sizing: border-box; 17 border: solid 2px; 18 height: 100px; 19 writing-mode: vertical-rl; 20 } 21 22 @supports (display: layout(block-size-100)) { 23 .custom-100 { 24 display: layout(block-size-100); 25 background: green; 26 } 27 .custom-50 { 28 display: layout(block-size-50); 29 background: green; 30 flex: 1; 31 } 32 } 33 </style> 34 <script src="/common/reftest-wait.js"></script> 35 <script src="/common/worklet-reftest.js"></script> 36 37 <!-- Tests that floats using an auto block size get positioned correctly. --> 38 <div class="flex"> 39 <div class="custom custom-100"></div> 40 <div class="custom custom-50"></div> 41 </div> 42 43 <script id="code" type="text/worklet"> 44 registerLayout('block-size-100', class { 45 async intrinsicSizes() {} 46 async layout() { 47 return {autoBlockSize: 100}; 48 } 49 }); 50 registerLayout('block-size-50', class { 51 async intrinsicSizes() {} 52 async layout() { 53 return {autoBlockSize: 50}; 54 } 55 }); 56 </script> 57 58 <script> 59 importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent); 60 </script> 61 </html>