Chromium Code Reviews| Index: Source/core/fetch/FontResource.cpp |
| diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp |
| index 1e99662cdbb3e9131f258cefe5b562f10c87ccc1..d573a1e1a44fa780d295777b342a2aa82f52998e 100644 |
| --- a/Source/core/fetch/FontResource.cpp |
| +++ b/Source/core/fetch/FontResource.cpp |
| @@ -36,13 +36,6 @@ |
| #include "public/platform/Platform.h" |
| #include "wtf/CurrentTime.h" |
| -#if ENABLE(SVG_FONTS) |
| -#include "core/SVGNames.h" |
| -#include "core/dom/XMLDocument.h" |
| -#include "core/html/HTMLCollection.h" |
| -#include "core/svg/SVGFontElement.h" |
| -#endif |
| - |
| namespace blink { |
| static const double fontLoadWaitLimitSec = 3.0; |
| @@ -89,9 +82,6 @@ FontResource::~FontResource() |
| void FontResource::trace(Visitor* visitor) |
|
eae
2014/10/23 22:02:34
Remove the entire overloaded function?
pdr.
2014/10/23 22:15:34
Done.
|
| { |
| -#if ENABLE(SVG_FONTS) |
| - visitor->trace(m_externalSVGDocument); |
| -#endif |
| Resource::trace(visitor); |
| } |
| @@ -153,71 +143,10 @@ bool FontResource::ensureCustomFontData() |
| FontPlatformData FontResource::platformDataFromCustomData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant) |
| { |
| -#if ENABLE(SVG_FONTS) |
| - if (m_externalSVGDocument) |
| - return FontPlatformData(size, bold, italic); |
| -#endif |
| ASSERT(m_fontData); |
| return m_fontData->fontPlatformData(size, bold, italic, orientation, widthVariant); |
| } |
| -#if ENABLE(SVG_FONTS) |
| -bool FontResource::ensureSVGFontData() |
| -{ |
| - if (!m_externalSVGDocument && !errorOccurred() && !isLoading()) { |
| - if (m_data) { |
| - m_externalSVGDocument = XMLDocument::createSVG(); |
| - |
| - OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml"); |
| - String svgSource = decoder->decode(m_data->data(), m_data->size()); |
| - svgSource = svgSource + decoder->flush(); |
| - |
| - m_externalSVGDocument->setContent(svgSource); |
| - |
| - if (decoder->sawError()) |
| - m_externalSVGDocument = nullptr; |
| - } |
| - if (m_externalSVGDocument) { |
| - recordPackageFormatHistogram(PackageFormatSVG); |
| - } else { |
| - setStatus(DecodeError); |
| - recordPackageFormatHistogram(PackageFormatUnknown); |
| - } |
| - } |
| - |
| - return m_externalSVGDocument; |
| -} |
| - |
| -SVGFontElement* FontResource::getSVGFontById(const String& fontName) const |
| -{ |
| - RefPtrWillBeRawPtr<TagCollection> collection = m_externalSVGDocument->getElementsByTagNameNS(SVGNames::fontTag.namespaceURI(), SVGNames::fontTag.localName()); |
| - if (!collection) |
| - return 0; |
| - |
| - unsigned collectionLength = collection->length(); |
| - if (!collectionLength) |
| - return 0; |
| - |
| -#if ENABLE(ASSERT) |
| - for (unsigned i = 0; i < collectionLength; ++i) { |
| - ASSERT(collection->item(i)); |
| - ASSERT(isSVGFontElement(collection->item(i))); |
| - } |
| -#endif |
| - |
| - if (fontName.isEmpty()) |
| - return toSVGFontElement(collection->item(0)); |
| - |
| - for (unsigned i = 0; i < collectionLength; ++i) { |
| - SVGFontElement* element = toSVGFontElement(collection->item(i)); |
| - if (element->getIdAttribute() == fontName) |
| - return element; |
| - } |
| - |
| - return 0; |
| -} |
| -#endif |
| - |
| bool FontResource::isSafeToUnlock() const |
| { |
| return m_data->hasOneRef(); |