tor-browser

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

font-family-src-quoted.html (1975B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset=utf-8>
      5 <link rel="author" title="Myles C. Maxfield" href="mailto:mmaxfield@apple.com">
      6 <link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-face-src-formats" />
      7 <meta name="assert" content="Tests that local() and url() in serialization of @font-face blocks are quoted"/>
      8 <script type="text/javascript" src="/resources/testharness.js"></script>
      9 <script type="text/javascript" src="/resources/testharnessreport.js"></script>
     10 <style id="style">
     11 /* 0 */
     12 @font-face {
     13    font-family: "A";
     14    src: local("B");
     15 }
     16 /* 1 */
     17 @font-face {
     18    font-family: "C";
     19    src: url("D") format("opentype");
     20 }
     21 /* 2 */
     22 @font-face {
     23    font-family: "E";
     24    src: url("F") format("opentype");
     25 }
     26 /* 3 */
     27 @font-face {
     28    font-family: "M";
     29    src: url("N\"O") format("opentype");
     30 }
     31 /* 4 */
     32 @font-face {
     33    font-family: "P";
     34    src: url("Q\A R") format("opentype");
     35 }
     36 /* 5 */
     37 @font-face {
     38    font-family: "S";
     39    src: url("T\\U") format("opentype");
     40 }
     41 /* 6 */
     42 @font-face {
     43    font-family: "V";
     44    src: local("W\"X");
     45 }
     46 /* 7 */
     47 @font-face {
     48    font-family: "Y";
     49    src: local("Z\A A");
     50 }
     51 /* 8 */
     52 @font-face {
     53    font-family: "B";
     54    src: local("C\\D");
     55 }
     56 </style>
     57 </head>
     58 <body>
     59 <script>
     60 test(function(t) {
     61    let rules = document.getElementById("style").sheet.cssRules;
     62    assert_not_equals(rules[0].cssText.indexOf('local("B")'), -1);
     63    assert_not_equals(rules[1].cssText.indexOf('opentype'), -1);
     64    assert_not_equals(rules[2].cssText.indexOf('F")'), -1);
     65    assert_not_equals(rules[3].cssText.indexOf('url(\"N\\\"O\")'), -1);
     66    assert_not_equals(rules[4].cssText.indexOf('url(\"Q\\a R\")'), -1);
     67    assert_not_equals(rules[5].cssText.indexOf('url(\"T\\\\U\")'), -1);
     68    assert_not_equals(rules[6].cssText.indexOf('local(\"W\\\"X\")'), -1);
     69    assert_not_equals(rules[7].cssText.indexOf('local(\"Z\\a A\")'), -1);
     70    assert_not_equals(rules[8].cssText.indexOf('local(\"C\\\\D\")'), -1);
     71 });
     72 </script>
     73 </body>
     74 </html>