tor-browser

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

font-face-003.html (975B)


      1 <!doctype html>
      2 <title>CSS Test: @font-face from document applies to :host.</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 <style>
      9 @font-face {
     10  font-family: ff-16-wide;
     11  src: url(/fonts/Ahem.ttf);
     12 }
     13 </style>
     14 <div id="host"><span id="in-document">1234567890</span></div>
     15 <script>
     16  promise_test(async function () {
     17  host.attachShadow({ mode: "open" }).innerHTML = `
     18    <style>
     19      :host {
     20        font-family: ff-16-wide;
     21      }
     22    </style>
     23    <slot></slot>
     24    <span id="in-shadow">0123456789</span>
     25  `;
     26 
     27  await document.fonts.ready;
     28  assert_equals(document.getElementById('in-document').offsetWidth, 160);
     29  assert_equals(host.shadowRoot.getElementById('in-shadow').offsetWidth, 160);
     30 }, "@font-face from document applies to :host");
     31 </script>