Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: LayoutTests/fast/css/font-face-unicode-range-load.html

Issue 23446007: Use unicode-range to prevent unnecessary @font-face donwnloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../js/resources/js-test-pre.js"></script>
4 <script>
5 description('Tests that unicode-range descriptor is used to selectively download fonts that are used in document.');
6
7 window.jsTestIsAsync = true;
8
9 var latin1Loaded = false;
10 var cyrillicLoaded = false;
11 var arabicLoaded = false;
12
13 function runTests() {
14 document.fontloader.addEventListener('load', onload);
15 document.fontloader.notifyWhenFontsReady(verify);
16 }
17
18 function onload(e) {
19 var src = e.fontface.style.getPropertyValue('src');
20 if (src.indexOf('Latin1') >= 0)
21 latin1Loaded = true;
22 if (src.indexOf('Cyrillic') >= 0)
23 cyrillicLoaded = true;
24 if (src.indexOf('Arabic') >= 0)
25 arabicLoaded = true;
26 }
27
28 function verify() {
29 shouldBeTrue('latin1Loaded'); // Latin-1 font is loaded for basic font metri cs.
30 shouldBeTrue('cyrillicLoaded');
31 shouldBeFalse('arabicLoaded');
32 finishJSTest();
33 }
34
35 if (document.fontloader)
36 runTests();
37 else {
38 testFailed('document.fontloader does not exist');
39 finishJSTest();
40 }
41 </script>
42 <style>
43 @font-face {
44 font-family: TestFont;
45 src: url('../../resources/NonExistentLatin1.woff'), local(Ahem);
46 unicode-range: U+00-0FF; /* Latin-1 */
47 }
48 @font-face {
49 font-family: TestFont;
50 src: url('../../resources/NonExistentCyrillic.woff'), local(Ahem);
51 unicode-range: U+0400-04FF; /* Cyrillic */
52 }
53 @font-face {
54 font-family: TestFont;
55 src: url('../../resources/NonExistentArabic.woff'), local(Ahem);
56 unicode-range: U+0600-06FF; /* Arabic */
57 }
58 #test {
59 font-family: TestFont;
60 }
61 </style>
62 </head>
63 <body>
64 <p id="test">&#x41F;&#x440;&#x43E;&#x432;&#x435;&#x440;&#x43A;&#x430;</p>
65 <script src="../js/resources/js-test-post.js"></script>
66 </body>
67 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/font-face-unicode-range-load-expected.txt » ('j') | Source/core/css/CSSFontFaceSource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698