Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / css / font-face-unicode-range-overlap-load.html
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 @font-face {
26     font-family: Test3;
27     src: url('../../resources/Ahem.ttf');
28     /* no unicode-range */
29 }
30 @font-face {
31     font-family: Test3;
32     src: url('../../resources/Ahem.otf');
33     unicode-range: U+00-FF;
34 }
35 </style>
36 <script>
37 description('Tests that only necessary fonts are loaded when font faces have overlapping unicode ranges.');
38
39 window.jsTestIsAsync = true;
40
41 function getDocumentFontFaces() {
42     var faces = [];
43     document.fonts.forEach(function(face) { faces.push(face); });
44     return faces;
45 }
46
47 document.fonts.ready().then(function() {
48     faces = getDocumentFontFaces();
49     shouldBe('faces.length', '6');
50     shouldBeEqualToString('faces[0].status', 'unloaded');
51     shouldBeEqualToString('faces[1].status', 'loaded');
52     shouldBeEqualToString('faces[2].status', 'loaded');
53     shouldBeEqualToString('faces[3].status', 'unloaded');
54     shouldBeEqualToString('faces[4].status', 'unloaded');
55     shouldBeEqualToString('faces[5].status', 'loaded');
56     finishJSTest();
57 });
58 </script>
59 </head>
60 <body>
61   <p style="font-family: Test1">I</p>
62   <p style="font-family: Test2">J</p>
63   <p style="font-family: Test3">K</p>
64 </body>
65 </html>