tor-browser

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

fontface-invalid-family.tentative.html (1297B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
      4 <link rel="author" title="Mozilla" href="https://mozilla.com">
      5 <link rel="help" href="https://drafts.csswg.org/css-font-loading-3/">
      6 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1986533">
      7 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6236">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script>
     11 // These are values that are invalid as a family-name, or CSS generics.
     12 const kInvalidValues = [
     13  "content:Segoe UI",
     14  "sans-serif",
     15  "A, B",
     16  "inherit",
     17  "a 1",
     18  "",
     19 ];
     20 
     21 for (let familyName of kInvalidValues) {
     22  promise_test(async function() {
     23    let face = new FontFace(familyName, "url('resources/Rochester.otf')");
     24    assert_not_equals(face.status, "error", `FontFace should be quoted after construction with invalid family name ${familyName}`);
     25    assert_equals(face.family, `"${familyName}"`, `FontFace.family should be the quoted string after construction with invalid family name ${familyName}`);
     26    await face.load();
     27    assert_true(true, `FontFace should load after invalid family name ${familyName} specified`);
     28  }, `family: ${familyName}`);
     29 }
     30 </script>