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

Unified Diff: LayoutTests/fast/css/font-face-unicode-range-overlap-load.html

Issue 243453003: Proper unicode-range font loading behavior (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/css/font-face-unicode-range-overlap-load.html
diff --git a/LayoutTests/fast/css/font-face-unicode-range-overlap-load.html b/LayoutTests/fast/css/font-face-unicode-range-overlap-load.html
new file mode 100644
index 0000000000000000000000000000000000000000..322137be381e18618f32d50cb49f67b1af8ac40a
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-unicode-range-overlap-load.html
@@ -0,0 +1,52 @@
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+<style>
+@font-face {
+ font-family: Test1;
+ src: url('../../resources/Ahem.ttf');
+ unicode-range: U+41-5A; /* 'A'-'Z' */
+}
+@font-face {
+ font-family: Test1;
+ src: url('../../resources/Ahem.otf');
+ unicode-range: U+49; /* 'I' */
+}
+@font-face {
+ font-family: Test2;
+ src: url('../../resources/Ahem.woff');
+ unicode-range: U+41-5A; /* 'A'-'Z' */
+}
+@font-face {
+ font-family: Test2;
+ src: url('../../resources/Ahem.woff2');
+ unicode-range: U+49; /* 'I' */
+}
+</style>
+<script>
+description('Tests that only necessary fonts are loaded when font faces have overlapping unicode ranges.');
+
+window.jsTestIsAsync = true;
+
+function getDocumentFontFaces() {
+ var faces = [];
+ document.fonts.forEach(function(face) { faces.push(face); });
+ return faces;
+}
+
+document.fonts.ready().then(function() {
+ faces = getDocumentFontFaces();
+ shouldBe('faces.length', '4');
+ shouldBeEqualToString('faces[0].status', 'unloaded');
+ shouldBeEqualToString('faces[1].status', 'loaded');
+ shouldBeEqualToString('faces[2].status', 'loaded');
+ shouldBeEqualToString('faces[3].status', 'unloaded');
+ finishJSTest();
+});
+</script>
+</head>
+<body>
+ <p style="font-family: Test1">I</p>
+ <p style="font-family: Test2">J</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698