tor-browser

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

flex-baseline.https.html (1292B)


      1 <!DOCTYPE html>
      2 <html class=reftest-wait>
      3 <link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#interaction-alignment">
      4 <link rel="match" href="../green-square-ref.html">
      5 <meta name="assert" content="This test checks that a baseline aligned element uses the baseline set in layout()."/>
      6 <style>
      7 .parent {
      8  background: red;
      9  display: flex;
     10  padding: 0 10px;
     11  width: 80px;
     12  height: 100px;
     13  align-items: baseline;
     14 }
     15 
     16 .child {
     17  color: red;
     18 }
     19 
     20 @supports (display: layout(parent)) {
     21  .parent {
     22    background: green;
     23  }
     24  .child {
     25    display: layout(child);
     26  }
     27 }
     28 </style>
     29 <script src="/common/reftest-wait.js"></script>
     30 <script src="/common/worklet-reftest.js"></script>
     31 
     32 <div class="parent">
     33  <div style="position: absolute; top: 50px; width: 50px; height: 25px; background: green;"></div>
     34  <div></div>
     35  <div class="child">text</div>
     36 </div>
     37 
     38 <script id="code" type="text/worklet">
     39 registerLayout('child', class {
     40  async intrinsicSizes() {}
     41  async layout(children) {
     42    const childFragments = await Promise.all(children.map(child => child.layoutNextFragment({})));
     43    return {childFragments, baseline: -50};
     44  }
     45 });
     46 </script>
     47 
     48 <script>
     49 importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, document.getElementById('code').textContent);
     50 </script>
     51 </html>