tor-browser

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

font-face-006.html (1044B)


      1 <!doctype html>
      2 <title>CSS Test: @font-face from document applies to :host::before/::after.</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 #host {
     14  float: left;
     15 }
     16 </style>
     17 <div id="host"></div>
     18 <script>
     19 promise_test(async () => {
     20  host.attachShadow({ mode: "open" }).innerHTML = `
     21    <style>
     22      :host::before, :host::after {
     23        font-family: ff-16-wide;
     24        content: "12345"
     25      }
     26    </style>
     27    <slot></slot>
     28  `;
     29 
     30  await document.fonts.ready;
     31 
     32  //shrinkwrapped size for a default font will be a bit more than 80-90
     33  //if the font is applied, it will be a bit more than 160
     34  assert_greater_than(document.getElementById('host').offsetWidth, 160);
     35 }, "@font-face from document applies to to :host::before/::after.");
     36 </script>