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

Unified Diff: Source/core/css/FontFaceSet.cpp

Issue 324293003: Change FontFaceSet#check() behavior when no matched font-face (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontFaceSet.cpp
diff --git a/Source/core/css/FontFaceSet.cpp b/Source/core/css/FontFaceSet.cpp
index 8d12c894c157cf84e889ce354b1a7bf9d0094784..01040c8ca7cb780f01e5ba9d4650ea78b3de8750 100644
--- a/Source/core/css/FontFaceSet.cpp
+++ b/Source/core/css/FontFaceSet.cpp
@@ -479,13 +479,25 @@ bool FontFaceSet::check(const String& fontString, const String& text, ExceptionS
return false;
}
- FontFaceCache* fontFaceCache = document()->styleEngine()->fontSelector()->fontFaceCache();
+ CSSFontSelector* fontSelector = document()->styleEngine()->fontSelector();
+ FontFaceCache* fontFaceCache = fontSelector->fontFaceCache();
+
+ bool hasLoadedFaces = false;
for (const FontFamily* f = &font.fontDescription().family(); f; f = f->next()) {
CSSSegmentedFontFace* face = fontFaceCache->get(font.fontDescription(), f->family());
- if (face && !face->checkFont(nullToSpace(text)))
- return false;
+ if (face) {
+ if (!face->checkFont(nullToSpace(text)))
+ return false;
+ hasLoadedFaces = true;
+ }
bashi 2014/06/13 06:55:15 Question: If face is null, it seems that we assume
}
- return true;
+ if (hasLoadedFaces)
+ return true;
+ for (const FontFamily* f = &font.fontDescription().family(); f; f = f->next()) {
+ if (fontSelector->isPlatformFontAvailable(font.fontDescription(), f->family()))
+ return true;
+ }
+ return false;
}
bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font)
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698