OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../resources/js-test.js"></script> |
| 4 <style> |
| 5 @font-face { |
| 6 font-family: Test1; |
| 7 src: url('../../resources/Ahem.ttf'); |
| 8 unicode-range: U+41-5A; /* 'A'-'Z' */ |
| 9 } |
| 10 @font-face { |
| 11 font-family: Test1; |
| 12 src: url('../../resources/Ahem.otf'); |
| 13 unicode-range: U+49; /* 'I' */ |
| 14 } |
| 15 @font-face { |
| 16 font-family: Test2; |
| 17 src: url('../../resources/Ahem.woff'); |
| 18 unicode-range: U+41-5A; /* 'A'-'Z' */ |
| 19 } |
| 20 @font-face { |
| 21 font-family: Test2; |
| 22 src: url('../../resources/Ahem.woff2'); |
| 23 unicode-range: U+49; /* 'I' */ |
| 24 } |
| 25 </style> |
| 26 <script> |
| 27 description('Tests that only necessary fonts are loaded when font faces have ove
rlapping unicode ranges.'); |
| 28 |
| 29 window.jsTestIsAsync = true; |
| 30 |
| 31 function getDocumentFontFaces() { |
| 32 var faces = []; |
| 33 document.fonts.forEach(function(face) { faces.push(face); }); |
| 34 return faces; |
| 35 } |
| 36 |
| 37 document.fonts.ready().then(function() { |
| 38 faces = getDocumentFontFaces(); |
| 39 shouldBe('faces.length', '4'); |
| 40 shouldBeEqualToString('faces[0].status', 'unloaded'); |
| 41 shouldBeEqualToString('faces[1].status', 'loaded'); |
| 42 shouldBeEqualToString('faces[2].status', 'loaded'); |
| 43 shouldBeEqualToString('faces[3].status', 'unloaded'); |
| 44 finishJSTest(); |
| 45 }); |
| 46 </script> |
| 47 </head> |
| 48 <body> |
| 49 <p style="font-family: Test1">I</p> |
| 50 <p style="font-family: Test2">J</p> |
| 51 </body> |
| 52 </html> |
OLD | NEW |