| Index: third_party/WebKit/Source/core/css/FontFace.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp
|
| index 59b526bbd633ddfb8043f35a64a24294a1792013..84645e2cdf7ae786797e0da1896432213e9521aa 100644
|
| --- a/third_party/WebKit/Source/core/css/FontFace.cpp
|
| +++ b/third_party/WebKit/Source/core/css/FontFace.cpp
|
| @@ -533,6 +533,11 @@ FontTraits FontFace::traits() const
|
| return FontTraits(style, variant, weight, stretch);
|
| }
|
|
|
| +bool FontFace::isBlank() const
|
| +{
|
| + return m_status == Loading && m_charCount > 200 && m_cssFontFace->isBlank();
|
| +}
|
| +
|
| static FontDisplay CSSValueToFontDisplay(CSSValue* value)
|
| {
|
| if (value && value->isPrimitiveValue()) {
|
| @@ -624,6 +629,21 @@ void FontFace::initCSSFontFace(const unsigned char* data, size_t size)
|
| m_cssFontFace->addSource(source);
|
| }
|
|
|
| +bool FontFace::willUseFontData(const FontDescription& fontDescription, const String& text)
|
| +{
|
| + if (m_status != Loaded) {
|
| + m_charCount += text.length();
|
| + // if (m_cssFontFace->isBlank())
|
| + // fprintf(stderr, "%s %u %u\n", m_family.getString().ascii().data(), length, m_charCount);
|
| + }
|
| + if (loadStatus() != Unloaded)
|
| + return true;
|
| + if (cssFontFace()->maybeScheduleFontLoad(fontDescription, text.characterStartingAt(0))) {
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| DEFINE_TRACE(FontFace)
|
| {
|
| visitor->trace(m_style);
|
|
|