diff options
author | Steve Block <steveblock@google.com> | 2010-02-02 14:57:50 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-04 15:06:55 +0000 |
commit | d0825bca7fe65beaee391d30da42e937db621564 (patch) | |
tree | 7461c49eb5844ffd1f35d1ba2c8b7584c1620823 /WebCore/css/CSSFontFace.cpp | |
parent | 3db770bd97c5a59b6c7574ca80a39e5a51c1defd (diff) | |
download | external_webkit-d0825bca7fe65beaee391d30da42e937db621564.zip external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.gz external_webkit-d0825bca7fe65beaee391d30da42e937db621564.tar.bz2 |
Merge webkit.org at r54127 : Initial merge by git
Change-Id: Ib661abb595522f50ea406f72d3a0ce17f7193c82
Diffstat (limited to 'WebCore/css/CSSFontFace.cpp')
-rw-r--r-- | WebCore/css/CSSFontFace.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/WebCore/css/CSSFontFace.cpp b/WebCore/css/CSSFontFace.cpp index 4d8da59..70cd9bb 100644 --- a/WebCore/css/CSSFontFace.cpp +++ b/WebCore/css/CSSFontFace.cpp @@ -77,8 +77,11 @@ void CSSFontFace::addSource(CSSFontFaceSource* source) source->setFontFace(this); } -void CSSFontFace::fontLoaded(CSSFontFaceSource*) +void CSSFontFace::fontLoaded(CSSFontFaceSource* source) { + if (source != m_activeSource) + return; + // FIXME: Can we assert that m_segmentedFontFaces is not empty? That may // require stopping in-progress font loading when the last // CSSSegmentedFontFace is removed. @@ -97,17 +100,22 @@ void CSSFontFace::fontLoaded(CSSFontFaceSource*) SimpleFontData* CSSFontFace::getFontData(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic) { + m_activeSource = 0; if (!isValid()) return 0; - + ASSERT(!m_segmentedFontFaces.isEmpty()); CSSFontSelector* fontSelector = (*m_segmentedFontFaces.begin())->fontSelector(); - SimpleFontData* result = 0; - unsigned size = m_sources.size(); - for (unsigned i = 0; i < size && !result; i++) - result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector); - return result; + size_t size = m_sources.size(); + for (size_t i = 0; i < size; ++i) { + if (SimpleFontData* result = m_sources[i]->getFontData(fontDescription, syntheticBold, syntheticItalic, fontSelector)) { + m_activeSource = m_sources[i]; + return result; + } + } + + return 0; } } |