|
1 <!DOCTYPE HTML> |
|
2 <html class="reftest-wait"> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 |
|
6 <!-- Testcase for bug 879963 regression. |
|
7 |
|
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. |
|
10 |
|
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. --> |
|
13 |
|
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> |
|
25 |
|
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> |
|
37 |
|
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> |
|
49 |
|
50 <style type="text/css"> |
|
51 body { |
|
52 font-family: serif; |
|
53 } |
|
54 .test { |
|
55 font-family: foo; |
|
56 } |
|
57 </style> |
|
58 |
|
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; |
|
65 |
|
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"; |
|
72 |
|
73 document.documentElement.removeAttribute("class"); |
|
74 } |
|
75 </script> |
|
76 |
|
77 </head> |
|
78 |
|
79 <body onload="run()"> |
|
80 <div> |
|
81 foo <span id="test">bar</span> baz |
|
82 </div> |
|
83 </body> |
|
84 |
|
85 </html> |