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

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

Issue 171823002: Make text visible when font loading takes longer than 3 seconds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 10 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/CSSFontFaceSource.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSFontFaceSource.cpp
diff --git a/Source/core/css/CSSFontFaceSource.cpp b/Source/core/css/CSSFontFaceSource.cpp
index b055ab9f08bd08612670f3feccaaf85e56549702..62521dcb13e6822dfe634a2878b22dcb552ae913 100644
--- a/Source/core/css/CSSFontFaceSource.cpp
+++ b/Source/core/css/CSSFontFaceSource.cpp
@@ -126,6 +126,13 @@ void CSSFontFaceSource::fontLoaded(FontResource*)
m_face->fontLoaded(this);
}
+void CSSFontFaceSource::fontLoadWaitLimitExceeded(FontResource*)
+{
+ pruneTable();
+ if (m_face)
+ m_face->fontLoadWaitLimitExceeded(this);
+}
+
PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription)
{
// If the font hasn't loaded or an error occurred, then we've got nothing.
@@ -223,7 +230,7 @@ PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription&
ASSERT_NOT_REACHED();
return nullptr;
}
- RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(true);
+ RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(true, m_font->exceedsFontLoadWaitLimit() ? CustomFontData::VisibleFallback : CustomFontData::InvisibleFallback);
cssFontData->setCSSFontFaceSource(this);
fontData = SimpleFontData::create(temporaryFont->platformData(), cssFontData);
}
« no previous file with comments | « Source/core/css/CSSFontFaceSource.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698