diff options
Diffstat (limited to 'Source/WebCore/loader/cache/CachedFont.cpp')
-rw-r--r-- | Source/WebCore/loader/cache/CachedFont.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Source/WebCore/loader/cache/CachedFont.cpp b/Source/WebCore/loader/cache/CachedFont.cpp index ea2ee14..60f0d6c 100644 --- a/Source/WebCore/loader/cache/CachedFont.cpp +++ b/Source/WebCore/loader/cache/CachedFont.cpp @@ -27,7 +27,8 @@ #include "config.h" #include "CachedFont.h" -#if PLATFORM(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID) || PLATFORM(BREWMP) +// FIXME: This should really be a blacklist instead of a whitelist +#if USE(CG) || PLATFORM(QT) || PLATFORM(GTK) || (PLATFORM(CHROMIUM) && (OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) || USE(SKIA_MAC_ON_CHROME))) || PLATFORM(HAIKU) || OS(WINCE) || PLATFORM(ANDROID) || PLATFORM(BREWMP) #define STORE_FONT_CUSTOM_PLATFORM_DATA #endif @@ -58,9 +59,6 @@ CachedFont::CachedFont(const String &url) : CachedResource(url, FontResource) , m_fontData(0) , m_loadInitiated(false) -#if ENABLE(SVG_FONTS) - , m_isSVGFont(false) -#endif { } @@ -105,9 +103,6 @@ void CachedFont::beginLoadIfNeeded(CachedResourceLoader* dl) bool CachedFont::ensureCustomFontData() { #ifdef STORE_FONT_CUSTOM_PLATFORM_DATA -#if ENABLE(SVG_FONTS) - ASSERT(!m_isSVGFont); -#endif if (!m_fontData && !errorOccurred() && !isLoading() && m_data) { m_fontData = createFontCustomPlatformData(m_data.get()); if (!m_fontData) @@ -134,13 +129,14 @@ FontPlatformData CachedFont::platformDataFromCustomData(float size, bool bold, b #if ENABLE(SVG_FONTS) bool CachedFont::ensureSVGFontData() { - ASSERT(m_isSVGFont); if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) { m_externalSVGDocument = SVGDocument::create(0, KURL()); RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml"); - - m_externalSVGDocument->setContent(decoder->decode(m_data->data(), m_data->size()) + decoder->flush()); + String svgSource = decoder->decode(m_data->data(), m_data->size()); + svgSource += decoder->flush(); + + m_externalSVGDocument->setContent(svgSource); if (decoder->sawError()) m_externalSVGDocument = 0; @@ -151,7 +147,6 @@ bool CachedFont::ensureSVGFontData() SVGFontElement* CachedFont::getSVGFontById(const String& fontName) const { - ASSERT(m_isSVGFont); RefPtr<NodeList> list = m_externalSVGDocument->getElementsByTagNameNS(SVGNames::fontTag.namespaceURI(), SVGNames::fontTag.localName()); if (!list) return 0; |