tor-browser

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

font-face-008.html (1010B)


      1 <!doctype html>
      2 <title>CSS Test: @font-face from shadow applies to ::slotted.</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <link rel="author" title="Alan Stearns" href="mailto:stearns@adobe.com">
      6 <link rel="help" href="https://drafts.csswg.org/css-scoping/#shadow-names">
      7 
      8 <div id="host"><span id="in-document">1234567890</span></div>
      9 <script>
     10 promise_test(async () => {
     11  host.attachShadow({ mode: "open" }).innerHTML = `
     12    <style>
     13      @font-face {
     14        font-family: ff-16-wide;
     15        src: url(/fonts/Ahem.ttf);
     16      }
     17      ::slotted(#in-document) {
     18        font-family: ff-16-wide;
     19      }
     20    </style>
     21    <slot></slot>
     22    <span id="in-shadow">0123456789</span>
     23  `;
     24 
     25  await document.fonts.ready;
     26 
     27  assert_equals(document.getElementById('in-document').offsetWidth, 160);
     28  assert_not_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160);
     29 }, "@font-face from shadow applies to a slotted element");
     30 </script>