| Index: Source/core/css/CSSFontFace.cpp
|
| diff --git a/Source/core/css/CSSFontFace.cpp b/Source/core/css/CSSFontFace.cpp
|
| index efb19e250a8e7bf92bcb5c59b60ee81aa0516d2a..4854ed1c5d2d84673e780461feb6a7673d4c694c 100644
|
| --- a/Source/core/css/CSSFontFace.cpp
|
| +++ b/Source/core/css/CSSFontFace.cpp
|
| @@ -67,6 +67,18 @@ void CSSFontFace::setSegmentedFontFace(CSSSegmentedFontFace* segmentedFontFace)
|
| m_segmentedFontFace = segmentedFontFace;
|
| }
|
|
|
| +void CSSFontFace::beginLoadingFontSoon(FontResource* resource)
|
| +{
|
| + if (!m_segmentedFontFace)
|
| + return;
|
| +
|
| + CSSFontSelector* fontSelector = m_segmentedFontFace->fontSelector();
|
| + fontSelector->beginLoadingFontSoon(resource);
|
| +
|
| + if (m_loadState == NotLoaded)
|
| + setLoadState(Loading);
|
| +}
|
| +
|
| void CSSFontFace::fontLoaded(CSSFontFaceSource* source)
|
| {
|
| if (source != m_activeSource)
|
| @@ -100,19 +112,20 @@ PassRefPtr<SimpleFontData> CSSFontFace::getFontData(const FontDescription& fontD
|
| ASSERT(m_segmentedFontFace);
|
| CSSFontSelector* fontSelector = m_segmentedFontFace->fontSelector();
|
|
|
| - if (m_loadState == NotLoaded)
|
| - setLoadState(Loading);
|
| -
|
| size_t size = m_sources.size();
|
| for (size_t i = 0; i < size; ++i) {
|
| if (RefPtr<SimpleFontData> result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector)) {
|
| m_activeSource = m_sources[i].get();
|
| + if (m_loadState == NotLoaded && (m_sources[i]->isLoading() || m_sources[i]->isLoaded()))
|
| + setLoadState(Loading);
|
| if (m_loadState == Loading && m_sources[i]->isLoaded())
|
| setLoadState(Loaded);
|
| return result.release();
|
| }
|
| }
|
|
|
| + if (m_loadState == NotLoaded)
|
| + setLoadState(Loading);
|
| if (m_loadState == Loading)
|
| setLoadState(Error);
|
| return 0;
|
|
|