merge in klp-release (no-op)
diff --git a/Source/core/platform/graphics/FontFallbackList.cpp b/Source/core/platform/graphics/FontFallbackList.cpp
index e3405e5..2426c89 100644
--- a/Source/core/platform/graphics/FontFallbackList.cpp
+++ b/Source/core/platform/graphics/FontFallbackList.cpp
@@ -88,6 +88,23 @@
}
}
+const FontData* FontFallbackList::primaryFontData(const Font* f) const
+{
+ for (unsigned fontIndex = 0; ; ++fontIndex) {
+ const FontData* fontData = fontDataAt(f, fontIndex);
+ if (!fontData) {
+ // All fonts are custom fonts and a loading. Return the first FontData.
+ // FIXME: Correct fallback to the default font.
+ return fontDataAt(f, 0);
+ }
+
+ // When a custom font is loading, we should use the correct fallback font to layout the text.
+ // Here skip the temporary font for the loading custom font which may not act as the correct fallback font.
+ if (!fontData->isLoading())
+ return fontData;
+ }
+}
+
const FontData* FontFallbackList::fontDataAt(const Font* font, unsigned realizedFontIndex) const
{
if (realizedFontIndex < m_fontList.size())
diff --git a/Source/core/platform/graphics/FontFallbackList.h b/Source/core/platform/graphics/FontFallbackList.h
index edf8dcb..877a9b8 100644
--- a/Source/core/platform/graphics/FontFallbackList.h
+++ b/Source/core/platform/graphics/FontFallbackList.h
@@ -93,7 +93,7 @@
return m_cachedPrimarySimpleFontData;
}
- const FontData* primaryFontData(const Font* f) const { return fontDataAt(f, 0); }
+ const FontData* primaryFontData(const Font*) const;
const FontData* fontDataAt(const Font*, unsigned index) const;
void setPlatformFont(const FontPlatformData&);