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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/font-face/dynamic-duplicate-rule-1c.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,85 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html class="reftest-wait">
     1.6 +<head>
     1.7 +<meta charset="utf-8">
     1.8 +
     1.9 +<!-- Testcase for bug 879963 regression.
    1.10 +
    1.11 +     This test is designed to hit the case where we were adding the same
    1.12 +     proxy font entry to a family multiple times during user font set updates.
    1.13 +
    1.14 +     Note that if a platform doesn't have any of the local() fonts listed,
    1.15 +     the testcase will "pass" harmlessly as a no-op. -->
    1.16 +
    1.17 +<style type="text/css" id="style1">
    1.18 +@font-face {
    1.19 +  font-family: foo;
    1.20 +  src: local("Arial"),
    1.21 +       local("DejaVu Sans"),
    1.22 +       local("Free Sans"),
    1.23 +       local("Open Sans"),
    1.24 +       local("Droid Sans"),
    1.25 +       local("Roboto");
    1.26 +}
    1.27 +</style>
    1.28 +
    1.29 +<style type="text/css" id="style2">
    1.30 +@font-face {
    1.31 +  font-family: foo;
    1.32 +  src: local("Arial"),
    1.33 +       local("DejaVu Sans"),
    1.34 +       local("Free Sans"),
    1.35 +       local("Open Sans"),
    1.36 +       local("Droid Sans"),
    1.37 +       local("Roboto");
    1.38 +}
    1.39 +</style>
    1.40 +
    1.41 +<style type="text/css" id="style3">
    1.42 +@font-face {
    1.43 +  font-family: foo;
    1.44 +  src: local("Arial"),
    1.45 +       local("DejaVu Sans"),
    1.46 +       local("Free Sans"),
    1.47 +       local("Open Sans"),
    1.48 +       local("Droid Sans"),
    1.49 +       local("Roboto");
    1.50 +}
    1.51 +</style>
    1.52 +
    1.53 +<style type="text/css">
    1.54 +body {
    1.55 +  font-family: serif;
    1.56 +}
    1.57 +.test {
    1.58 +  font-family: foo;
    1.59 +}
    1.60 +</style>
    1.61 +
    1.62 +<script type="application/javascript">
    1.63 +function run() {
    1.64 +  // Disable one of our three identical style elements.
    1.65 +  // This will trigger an update of the user font set,
    1.66 +  // and there will still be two identical rules present.
    1.67 +  document.getElementById("style3").disabled = true;
    1.68 +
    1.69 +  // Now we trigger the use of the 'foo' font family,
    1.70 +  // so that font loading occurs.
    1.71 +  // If there are duplicate proxy entries in the family,
    1.72 +  // and only the first one gets replaced by the real face,
    1.73 +  // blank text will result.
    1.74 +  document.getElementById("test").className = "test";
    1.75 +
    1.76 +  document.documentElement.removeAttribute("class");
    1.77 +}
    1.78 +</script>
    1.79 +
    1.80 +</head>
    1.81 +
    1.82 +<body onload="run()">
    1.83 +<div>
    1.84 +foo <span id="test">bar</span> baz
    1.85 +</div>
    1.86 +</body>
    1.87 +
    1.88 +</html>

mercurial