Chromium Code Reviews| 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) |