Index: Source/core/css/CSSFontSelector.cpp |
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp |
index d984785f0638362ca88bdce4deb68553a3cea4a3..473f6faf2f06a4de941ca68333f0dd867d024959 100644 |
--- a/Source/core/css/CSSFontSelector.cpp |
+++ b/Source/core/css/CSSFontSelector.cpp |
@@ -47,6 +47,8 @@ CSSFontSelector::CSSFontSelector(Document* document) |
: m_document(document) |
, m_fontLoader(FontLoader::create(this, document)) |
, m_genericFontFamilySettings(document->frame()->settings()->genericFontFamilySettings()) |
+ , m_firstNonBlankTextReported(false) |
+ , m_firstCustomFontTextReported(false) |
{ |
// FIXME: An old comment used to say there was no need to hold a reference to m_document |
// because "we are guaranteed to be destroyed before the document". But there does not |
@@ -128,6 +130,20 @@ static AtomicString familyNameFromSettings(const GenericFontFamilySettings& sett |
return emptyAtom; |
} |
+void CSSFontSelector::reportFirstNonBlankText(bool isCustomFont) |
+{ |
+ if (isCustomFont) { |
+ if (m_firstCustomFontTextReported) |
kinuko
2015/09/14 14:14:33
Looks like common pattern is doing something like
Kunihiko Sakamoto
2015/09/15 05:11:01
Done.
|
+ return; |
+ m_document->mutableTiming().markFirstCustomFontText(); |
+ m_firstCustomFontTextReported = true; |
+ } |
+ if (m_firstNonBlankTextReported) |
+ return; |
+ m_document->mutableTiming().markFirstNonBlankText(); |
+ m_firstNonBlankTextReported = true; |
+} |
+ |
PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName) |
{ |
if (CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, familyName)) |