Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / fetch / FontResource.cpp
index 1e99662..98c9f2f 100644 (file)
 #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;
@@ -87,14 +80,6 @@ FontResource::~FontResource()
 {
 }
 
-void FontResource::trace(Visitor* visitor)
-{
-#if ENABLE(SVG_FONTS)
-    visitor->trace(m_externalSVGDocument);
-#endif
-    Resource::trace(visitor);
-}
-
 void FontResource::didScheduleLoad()
 {
     if (m_state == Unloaded)
@@ -153,71 +138,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();