summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/css/CSSFontSelector.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/css/CSSFontSelector.cpp
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/css/CSSFontSelector.cpp')
-rw-r--r--Source/WebCore/css/CSSFontSelector.cpp31
1 files changed, 25 insertions, 6 deletions
diff --git a/Source/WebCore/css/CSSFontSelector.cpp b/Source/WebCore/css/CSSFontSelector.cpp
index 9c9a844..8024afa 100644
--- a/Source/WebCore/css/CSSFontSelector.cpp
+++ b/Source/WebCore/css/CSSFontSelector.cpp
@@ -247,11 +247,11 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
if (allowDownloading && item->isSupportedFormat() && m_document) {
CachedFont* cachedFont = m_document->cachedResourceLoader()->requestFont(item->resource());
if (cachedFont) {
+ source = new CSSFontFaceSource(item->resource(), cachedFont);
#if ENABLE(SVG_FONTS)
if (foundSVGFont)
- cachedFont->setSVGFont(true);
+ source->setHasExternalSVGFont(true);
#endif
- source = new CSSFontFaceSource(item->resource(), cachedFont);
}
}
} else {
@@ -345,18 +345,37 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
}
}
-void CSSFontSelector::fontLoaded()
+void CSSFontSelector::registerForInvalidationCallbacks(FontSelectorClient* client)
+{
+ m_clients.add(client);
+}
+
+void CSSFontSelector::unregisterForInvalidationCallbacks(FontSelectorClient* client)
+{
+ m_clients.remove(client);
+}
+
+void CSSFontSelector::dispatchInvalidationCallbacks()
{
+ Vector<FontSelectorClient*> clients;
+ copyToVector(m_clients, clients);
+ for (size_t i = 0; i < clients.size(); ++i)
+ clients[i]->fontsNeedUpdate(this);
+
+ // FIXME: Make Document a FontSelectorClient so that it can simply register for invalidation callbacks.
if (!m_document || m_document->inPageCache() || !m_document->renderer())
return;
m_document->scheduleForcedStyleRecalc();
}
+void CSSFontSelector::fontLoaded()
+{
+ dispatchInvalidationCallbacks();
+}
+
void CSSFontSelector::fontCacheInvalidated()
{
- if (!m_document || m_document->inPageCache() || !m_document->renderer())
- return;
- m_document->scheduleForcedStyleRecalc();
+ dispatchInvalidationCallbacks();
}
static FontData* fontDataForGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)