diff options
author | fs <fs@opera.com> | 2015-10-23 11:45:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-23 18:48:01 +0000 |
commit | fc76b7e7f854c3791e683f3c9e81d27d9812be78 (patch) | |
tree | 2f6ec4ba3be88bf70281d0303988e36d539b7088 | |
parent | f78489463023c945a97ba6b37cd5fbd7b57b8478 (diff) | |
download | chromium_src-fc76b7e7f854c3791e683f3c9e81d27d9812be78.zip chromium_src-fc76b7e7f854c3791e683f3c9e81d27d9812be78.tar.gz chromium_src-fc76b7e7f854c3791e683f3c9e81d27d9812be78.tar.bz2 |
Remove some dead code in SVG "mixins"
addSupportedAttributes() is no longer used (handled by the property
map). Ditto for SVGFitToViewBox::parseAttribute and
SVGTests::parseAttribute.
Also drop the Document& to SVGTests::isValid since it isn't used.
Review URL: https://codereview.chromium.org/1420263002
Cr-Commit-Position: refs/heads/master@{#355842}
15 files changed, 9 insertions, 76 deletions
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimationElement.h b/third_party/WebKit/Source/core/svg/SVGAnimationElement.h index 6b2ffb8..4e66de4 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimationElement.h +++ b/third_party/WebKit/Source/core/svg/SVGAnimationElement.h @@ -178,7 +178,7 @@ protected: static bool parseValues(const String&, Vector<String>& result); private: - bool isValid() const final { return SVGTests::isValid(document()); } + bool isValid() const final { return SVGTests::isValid(); } void animationAttributeChanged() override; void setAttributeType(const AtomicString&); diff --git a/third_party/WebKit/Source/core/svg/SVGCursorElement.h b/third_party/WebKit/Source/core/svg/SVGCursorElement.h index 546af6e..e41d8cb 100644 --- a/third_party/WebKit/Source/core/svg/SVGCursorElement.h +++ b/third_party/WebKit/Source/core/svg/SVGCursorElement.h @@ -54,7 +54,7 @@ public: private: explicit SVGCursorElement(Document&); - bool isValid() const override { return SVGTests::isValid(document()); } + bool isValid() const override { return SVGTests::isValid(); } void svgAttributeChanged(const QualifiedName&) override; diff --git a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp index 6771cd7..481777b 100644 --- a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp +++ b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.cpp @@ -96,12 +96,6 @@ bool SVGFitToViewBox::isKnownAttribute(const QualifiedName& attrName) return attrName == SVGNames::viewBoxAttr || attrName == SVGNames::preserveAspectRatioAttr; } -void SVGFitToViewBox::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) -{ - supportedAttributes.add(SVGNames::viewBoxAttr); - supportedAttributes.add(SVGNames::preserveAspectRatioAttr); -} - void SVGFitToViewBox::updateViewBox(const FloatRect& rect) { ASSERT(m_viewBox); diff --git a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.h b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.h index db2bd05..8943200 100644 --- a/third_party/WebKit/Source/core/svg/SVGFitToViewBox.h +++ b/third_party/WebKit/Source/core/svg/SVGFitToViewBox.h @@ -23,21 +23,16 @@ #define SVGFitToViewBox_h #include "core/SVGNames.h" -#include "core/dom/Document.h" #include "core/dom/QualifiedName.h" #include "core/svg/SVGAnimatedPreserveAspectRatio.h" #include "core/svg/SVGAnimatedRect.h" -#include "core/svg/SVGDocumentExtensions.h" -#include "core/svg/SVGParsingError.h" #include "core/svg/SVGPreserveAspectRatio.h" #include "core/svg/SVGRect.h" #include "platform/heap/Handle.h" -#include "wtf/HashSet.h" namespace blink { class AffineTransform; -class Document; class SVGFitToViewBox : public WillBeGarbageCollectedMixin { public: @@ -49,20 +44,6 @@ public: static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, PassRefPtrWillBeRawPtr<SVGPreserveAspectRatio>, float viewWidth, float viewHeight); static bool isKnownAttribute(const QualifiedName&); - static void addSupportedAttributes(HashSet<QualifiedName>&); - - bool parseAttribute(const QualifiedName& name, const AtomicString& value, Document& document, SVGParsingError& parseError) - { - if (name == SVGNames::viewBoxAttr) { - m_viewBox->setBaseValueAsString(value, parseError); - return true; - } - if (name == SVGNames::preserveAspectRatioAttr) { - m_preserveAspectRatio->setBaseValueAsString(value, parseError); - return true; - } - return false; - } bool hasEmptyViewBox() const { return m_viewBox->currentValue()->isValid() && m_viewBox->currentValue()->value().isEmpty(); } diff --git a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h index f972623..88b763d 100644 --- a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h +++ b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.h @@ -61,7 +61,7 @@ public: virtual FloatRect getBBox(); PassRefPtrWillBeRawPtr<SVGRectTearOff> getBBoxFromJavascript(); - bool isValid() const final { return SVGTests::isValid(document()); } + bool isValid() const final { return SVGTests::isValid(); } SVGAnimatedTransformList* transform() { return m_transform.get(); } const SVGAnimatedTransformList* transform() const { return m_transform.get(); } diff --git a/third_party/WebKit/Source/core/svg/SVGMaskElement.h b/third_party/WebKit/Source/core/svg/SVGMaskElement.h index e1724ec..2bae142 100644 --- a/third_party/WebKit/Source/core/svg/SVGMaskElement.h +++ b/third_party/WebKit/Source/core/svg/SVGMaskElement.h @@ -50,7 +50,7 @@ public: private: explicit SVGMaskElement(Document&); - bool isValid() const override { return SVGTests::isValid(document()); } + bool isValid() const override { return SVGTests::isValid(); } bool needsPendingResourceHandling() const override { return false; } bool isPresentationAttribute(const QualifiedName&) const override; diff --git a/third_party/WebKit/Source/core/svg/SVGPatternElement.h b/third_party/WebKit/Source/core/svg/SVGPatternElement.h index 779256b..e7f94e9 100644 --- a/third_party/WebKit/Source/core/svg/SVGPatternElement.h +++ b/third_party/WebKit/Source/core/svg/SVGPatternElement.h @@ -65,7 +65,7 @@ public: private: explicit SVGPatternElement(Document&); - bool isValid() const override { return SVGTests::isValid(document()); } + bool isValid() const override { return SVGTests::isValid(); } bool needsPendingResourceHandling() const override { return false; } void svgAttributeChanged(const QualifiedName&) override; diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp index fce14cf..f1a5f4d 100644 --- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp @@ -42,6 +42,7 @@ #include "core/layout/svg/LayoutSVGRoot.h" #include "core/layout/svg/LayoutSVGViewportContainer.h" #include "core/svg/SVGAngleTearOff.h" +#include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGNumberTearOff.h" #include "core/svg/SVGPreserveAspectRatio.h" #include "core/svg/SVGRectTearOff.h" diff --git a/third_party/WebKit/Source/core/svg/SVGTests.cpp b/third_party/WebKit/Source/core/svg/SVGTests.cpp index 2458e44..dd4cc34 100644 --- a/third_party/WebKit/Source/core/svg/SVGTests.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTests.cpp @@ -46,7 +46,7 @@ DEFINE_TRACE(SVGTests) visitor->trace(m_systemLanguage); } -bool SVGTests::isValid(Document& document) const +bool SVGTests::isValid() const { // No need to check requiredFeatures since hasFeature always returns true. @@ -71,26 +71,6 @@ bool SVGTests::isValid(Document& document) const return true; } -bool SVGTests::parseAttribute(const QualifiedName& name, const AtomicString& value) -{ - // FIXME: Should handle exceptions here. - // This is safe as of now, as the current impl of SVGStringList::setValueAsString never fails. - SVGParsingError parseError = NoError; - - if (name == SVGNames::requiredFeaturesAttr) - m_requiredFeatures->setBaseValueAsString(value, parseError); - else if (name == SVGNames::requiredExtensionsAttr) - m_requiredExtensions->setBaseValueAsString(value, parseError); - else if (name == SVGNames::systemLanguageAttr) - m_systemLanguage->setBaseValueAsString(value, parseError); - else - return false; - - ASSERT(parseError == NoError); - - return true; -} - bool SVGTests::isKnownAttribute(const QualifiedName& attrName) { return attrName == SVGNames::requiredFeaturesAttr @@ -98,11 +78,4 @@ bool SVGTests::isKnownAttribute(const QualifiedName& attrName) || attrName == SVGNames::systemLanguageAttr; } -void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) -{ - supportedAttributes.add(SVGNames::requiredFeaturesAttr); - supportedAttributes.add(SVGNames::requiredExtensionsAttr); - supportedAttributes.add(SVGNames::systemLanguageAttr); -} - } diff --git a/third_party/WebKit/Source/core/svg/SVGTests.h b/third_party/WebKit/Source/core/svg/SVGTests.h index 2d83acc..097c160 100644 --- a/third_party/WebKit/Source/core/svg/SVGTests.h +++ b/third_party/WebKit/Source/core/svg/SVGTests.h @@ -24,7 +24,6 @@ #include "core/CoreExport.h" #include "core/svg/SVGStaticStringList.h" #include "platform/heap/Handle.h" -#include "wtf/HashSet.h" namespace blink { @@ -39,13 +38,10 @@ public: SVGStringListTearOff* requiredExtensions() { return m_requiredExtensions->tearOff(); } SVGStringListTearOff* systemLanguage() { return m_systemLanguage->tearOff(); } - bool isValid(Document&) const; + bool isValid() const; - bool parseAttribute(const QualifiedName&, const AtomicString&); bool isKnownAttribute(const QualifiedName&); - void addSupportedAttributes(HashSet<QualifiedName>&); - DECLARE_VIRTUAL_TRACE(); protected: diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp index 382bb24..bc5d6cd 100644 --- a/third_party/WebKit/Source/core/svg/SVGURIReference.cpp +++ b/third_party/WebKit/Source/core/svg/SVGURIReference.cpp @@ -105,9 +105,4 @@ Element* SVGURIReference::targetElementFromIRIString(const String& iri, const Tr return treeScope.getElementById(id); } -void SVGURIReference::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) -{ - supportedAttributes.add(XLinkNames::hrefAttr); -} - } diff --git a/third_party/WebKit/Source/core/svg/SVGURIReference.h b/third_party/WebKit/Source/core/svg/SVGURIReference.h index bfaddad..1caa06a 100644 --- a/third_party/WebKit/Source/core/svg/SVGURIReference.h +++ b/third_party/WebKit/Source/core/svg/SVGURIReference.h @@ -35,7 +35,6 @@ public: virtual ~SVGURIReference() { } bool isKnownAttribute(const QualifiedName&); - void addSupportedAttributes(HashSet<QualifiedName>&); static AtomicString fragmentIdentifierFromIRIString(const String&, const TreeScope&); static Element* targetElementFromIRIString(const String&, const TreeScope&, AtomicString* = 0, Document* = 0); diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp index 43a30d1..14e7350 100644 --- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp @@ -37,6 +37,7 @@ #include "core/fetch/FetchRequest.h" #include "core/fetch/ResourceFetcher.h" #include "core/layout/svg/LayoutSVGTransformableContainer.h" +#include "core/svg/SVGDocumentExtensions.h" #include "core/svg/SVGGElement.h" #include "core/svg/SVGLengthContext.h" #include "core/svg/SVGSVGElement.h" diff --git a/third_party/WebKit/Source/core/svg/SVGZoomAndPan.cpp b/third_party/WebKit/Source/core/svg/SVGZoomAndPan.cpp index ada7d6c..0e3db78 100644 --- a/third_party/WebKit/Source/core/svg/SVGZoomAndPan.cpp +++ b/third_party/WebKit/Source/core/svg/SVGZoomAndPan.cpp @@ -41,11 +41,6 @@ bool SVGZoomAndPan::isKnownAttribute(const QualifiedName& attrName) return attrName == SVGNames::zoomAndPanAttr; } -void SVGZoomAndPan::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes) -{ - supportedAttributes.add(SVGNames::zoomAndPanAttr); -} - static const LChar disable[] = {'d', 'i', 's', 'a', 'b', 'l', 'e'}; static const LChar magnify[] = {'m', 'a', 'g', 'n', 'i', 'f', 'y'}; diff --git a/third_party/WebKit/Source/core/svg/SVGZoomAndPan.h b/third_party/WebKit/Source/core/svg/SVGZoomAndPan.h index 116a47b..7a67150 100644 --- a/third_party/WebKit/Source/core/svg/SVGZoomAndPan.h +++ b/third_party/WebKit/Source/core/svg/SVGZoomAndPan.h @@ -24,7 +24,6 @@ #include "core/SVGNames.h" #include "core/dom/QualifiedName.h" -#include "wtf/HashSet.h" namespace blink { @@ -48,7 +47,6 @@ public: virtual ~SVGZoomAndPan() { } static bool isKnownAttribute(const QualifiedName&); - static void addSupportedAttributes(HashSet<QualifiedName>&); static SVGZoomAndPanType parseFromNumber(unsigned short number) { |