tor-browser

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

fallback-url-to-local.html (985B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Test that font fallback from a pending web font to an available local font works.</title>
      4 <link rel=help href="https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm">
      5 <link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1101483">
      6 <link rel=author href="mailto:xiaochengh@chromium.org">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <style>
     10 @font-face {
     11  font-family: remote-font;
     12  src: url("/fonts/Revalia.woff?pipe=trickle(d1)") format(woff);
     13 }
     14 
     15 @font-face {
     16  font-family: local-font;
     17  src: local(Ahem);
     18 }
     19 
     20 #target {
     21  font: 25px/1 remote-font, local-font, monospace;
     22 }
     23 </style>
     24 <span id="target">0123456789</span>
     25 <script>
     26 test(() => {
     27  assert_false(document.fonts.check('25px/1 remote-font'));
     28  assert_equals(target.offsetWidth, 250);
     29 }, 'We should use the local font to render the page when the primary remote font is loading');
     30 </script>