tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

unresolved-promise.https.html (1093B)


      1 <!DOCTYPE html>
      2 <html class=reftest-wait>
      3 <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#invoke-an-intrinsic-sizes-callback">
      4 <link rel="match" href="fallback-ref.html">
      5 <meta name="assert" content="This test checks that a layout() class with an intrinsicSizes function that doesn't return a promise will fallback to block layout." />
      6 <style>
      7 .test {
      8  background: red;
      9  border: solid 2px;
     10  width: min-content;
     11 }
     12 
     13 .child {
     14  height: 100px;
     15 }
     16 
     17 @supports (display: layout(unresolved-promise)) {
     18  .test {
     19    display: layout(unresolved-promise);
     20    background: green;
     21  }
     22 }
     23 </style>
     24 <script src="/common/reftest-wait.js"></script>
     25 <script src="/common/worklet-reftest.js"></script>
     26 
     27 <div class="test">
     28  <div class="child"></div>
     29 </div>
     30 
     31 <script id="code" type="text/worklet">
     32 registerLayout('unresolved-promise', class {
     33  intrinsicSizes() { return new Promise(() => { /* never resolves */ }); }
     34  async layout() {}
     35 });
     36 </script>
     37 
     38 <script>
     39 importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
     40 </script>
     41 </html>