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

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

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: invalidation guard tweaks 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/SVGGradientElement.cpp
diff --git a/Source/core/svg/SVGGradientElement.cpp b/Source/core/svg/SVGGradientElement.cpp
index 3a3c53c4b9ab2538de1a19530bd426d5c59212a6..0364455d1a0ee7d04cd3b1b90e6cdd681da798f6 100644
--- a/Source/core/svg/SVGGradientElement.cpp
+++ b/Source/core/svg/SVGGradientElement.cpp
@@ -63,30 +63,23 @@ DEFINE_TRACE(SVGGradientElement)
SVGURIReference::trace(visitor);
}
-bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::gradientUnitsAttr);
- supportedAttributes.add(SVGNames::gradientTransformAttr);
- supportedAttributes.add(SVGNames::spreadMethodAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
+ if (attrName == SVGNames::gradientUnitsAttr
+ || attrName == SVGNames::gradientTransformAttr
+ || attrName == SVGNames::spreadMethodAttr
+ || SVGURIReference::isKnownAttribute(attrName))
+ {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
+ if (renderer)
+ renderer->invalidateCacheAndMarkForLayout();
+
return;
}
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
- if (renderer)
- renderer->invalidateCacheAndMarkForLayout();
+ SVGElement::svgAttributeChanged(attrName);
}
void SVGGradientElement::childrenChanged(const ChildrenChange& change)

Powered by Google App Engine
This is Rietveld 408576698