layout/reftests/font-face/dynamic-duplicate-rule-1c.html

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 <!DOCTYPE HTML>
     2 <html class="reftest-wait">
     3 <head>
     4 <meta charset="utf-8">
     6 <!-- Testcase for bug 879963 regression.
     8      This test is designed to hit the case where we were adding the same
     9      proxy font entry to a family multiple times during user font set updates.
    11      Note that if a platform doesn't have any of the local() fonts listed,
    12      the testcase will "pass" harmlessly as a no-op. -->
    14 <style type="text/css" id="style1">
    15 @font-face {
    16   font-family: foo;
    17   src: local("Arial"),
    18        local("DejaVu Sans"),
    19        local("Free Sans"),
    20        local("Open Sans"),
    21        local("Droid Sans"),
    22        local("Roboto");
    23 }
    24 </style>
    26 <style type="text/css" id="style2">
    27 @font-face {
    28   font-family: foo;
    29   src: local("Arial"),
    30        local("DejaVu Sans"),
    31        local("Free Sans"),
    32        local("Open Sans"),
    33        local("Droid Sans"),
    34        local("Roboto");
    35 }
    36 </style>
    38 <style type="text/css" id="style3">
    39 @font-face {
    40   font-family: foo;
    41   src: local("Arial"),
    42        local("DejaVu Sans"),
    43        local("Free Sans"),
    44        local("Open Sans"),
    45        local("Droid Sans"),
    46        local("Roboto");
    47 }
    48 </style>
    50 <style type="text/css">
    51 body {
    52   font-family: serif;
    53 }
    54 .test {
    55   font-family: foo;
    56 }
    57 </style>
    59 <script type="application/javascript">
    60 function run() {
    61   // Disable one of our three identical style elements.
    62   // This will trigger an update of the user font set,
    63   // and there will still be two identical rules present.
    64   document.getElementById("style3").disabled = true;
    66   // Now we trigger the use of the 'foo' font family,
    67   // so that font loading occurs.
    68   // If there are duplicate proxy entries in the family,
    69   // and only the first one gets replaced by the real face,
    70   // blank text will result.
    71   document.getElementById("test").className = "test";
    73   document.documentElement.removeAttribute("class");
    74 }
    75 </script>
    77 </head>
    79 <body onload="run()">
    80 <div>
    81 foo <span id="test">bar</span> baz
    82 </div>
    83 </body>
    85 </html>

mercurial