Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: Source/core/svg/SVGRemoteFontFaceSource.cpp

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/svg/SVGRemoteFontFaceSource.cpp
diff --git a/Source/core/svg/SVGRemoteFontFaceSource.cpp b/Source/core/svg/SVGRemoteFontFaceSource.cpp
deleted file mode 100644
index 3c2582ad445ea667ee45eb409c6492508b039c84..0000000000000000000000000000000000000000
--- a/Source/core/svg/SVGRemoteFontFaceSource.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#if ENABLE(SVG_FONTS)
-#include "core/svg/SVGRemoteFontFaceSource.h"
-
-#include "core/SVGNames.h"
-#include "core/css/FontLoader.h"
-#include "core/dom/ElementTraversal.h"
-#include "core/svg/SVGFontData.h"
-#include "core/svg/SVGFontElement.h"
-#include "core/svg/SVGFontFaceElement.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/fonts/SimpleFontData.h"
-
-namespace blink {
-
-SVGRemoteFontFaceSource::SVGRemoteFontFaceSource(const String& uri, FontResource* font, PassRefPtrWillBeRawPtr<FontLoader> fontLoader)
- : RemoteFontFaceSource(font, fontLoader)
- , m_uri(uri)
-{
-}
-
-SVGRemoteFontFaceSource::~SVGRemoteFontFaceSource()
-{
-}
-
-bool SVGRemoteFontFaceSource::ensureFontData()
-{
- return resource()->ensureSVGFontData();
-}
-
-PassRefPtr<SimpleFontData> SVGRemoteFontFaceSource::createFontData(const FontDescription& fontDescription)
-{
- if (!isLoaded())
- return createLoadingFallbackFontData(fontDescription);
-
- // Parse the external SVG document, and extract the <font> element.
- if (!resource()->ensureSVGFontData())
- return nullptr;
-
- if (!m_externalSVGFontElement) {
- String fragmentIdentifier;
- size_t start = m_uri.find('#');
- if (start != kNotFound)
- fragmentIdentifier = m_uri.substring(start + 1);
- m_externalSVGFontElement = resource()->getSVGFontById(fragmentIdentifier);
- }
-
- if (!m_externalSVGFontElement)
- return nullptr;
-
- // Select first <font-face> child
- if (SVGFontFaceElement* fontFaceElement = Traversal<SVGFontFaceElement>::firstChild(*m_externalSVGFontElement)) {
- return SimpleFontData::create(
- SVGFontData::create(fontFaceElement),
- fontDescription.effectiveFontSize(),
- fontDescription.isSyntheticBold(),
- fontDescription.isSyntheticItalic());
- }
- return nullptr;
-}
-
-void SVGRemoteFontFaceSource::trace(Visitor* visitor)
-{
- visitor->trace(m_externalSVGFontElement);
- RemoteFontFaceSource::trace(visitor);
-}
-
-} // namespace blink
-
-#endif // ENABLE(SVG_FONTS)

Powered by Google App Engine
This is Rietveld 408576698