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

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

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixups Created 5 years, 8 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/SVGRadialGradientElement.cpp
diff --git a/Source/core/svg/SVGRadialGradientElement.cpp b/Source/core/svg/SVGRadialGradientElement.cpp
index 32481b134d2e866bf7dac188511ade04cd31e3b3..fb617b6f406217656c1af6fc7b81cbd78462c3ba 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -67,34 +67,23 @@ DEFINE_TRACE(SVGRadialGradientElement)
DEFINE_NODE_FACTORY(SVGRadialGradientElement)
-bool SVGRadialGradientElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::cxAttr);
- supportedAttributes.add(SVGNames::cyAttr);
- supportedAttributes.add(SVGNames::fxAttr);
- supportedAttributes.add(SVGNames::fyAttr);
- supportedAttributes.add(SVGNames::rAttr);
- supportedAttributes.add(SVGNames::frAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGRadialGradientElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGradientElement::svgAttributeChanged(attrName);
- return;
- }
+ if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
+ || attrName == SVGNames::fxAttr || attrName == SVGNames::fyAttr
+ || attrName == SVGNames::rAttr || attrName == SVGNames::frAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ updateRelativeLengthsInformation();
- SVGElement::InvalidationGuard invalidationGuard(this);
+ LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
+ if (renderer)
+ renderer->invalidateCacheAndMarkForLayout();
- updateRelativeLengthsInformation();
+ return;
+ }
- LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
- if (renderer)
- renderer->invalidateCacheAndMarkForLayout();
+ SVGGradientElement::svgAttributeChanged(attrName);
}
LayoutObject* SVGRadialGradientElement::createLayoutObject(const ComputedStyle&)

Powered by Google App Engine
This is Rietveld 408576698