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

Unified Diff: Source/core/svg/SVGLinearGradientElement.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/SVGLinearGradientElement.cpp
diff --git a/Source/core/svg/SVGLinearGradientElement.cpp b/Source/core/svg/SVGLinearGradientElement.cpp
index ec7a890eef226f4b93f11e01ed7e8303236f8c75..abae7ef59348cd6696908f1a9aa9f25236519130 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -57,32 +57,22 @@ DEFINE_TRACE(SVGLinearGradientElement)
DEFINE_NODE_FACTORY(SVGLinearGradientElement)
-bool SVGLinearGradientElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::x1Attr);
- supportedAttributes.add(SVGNames::x2Attr);
- supportedAttributes.add(SVGNames::y1Attr);
- supportedAttributes.add(SVGNames::y2Attr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGradientElement::svgAttributeChanged(attrName);
- return;
- }
+ if (attrName == SVGNames::x1Attr || attrName == SVGNames::x2Attr
+ || attrName == SVGNames::y1Attr || attrName == SVGNames::y2Attr) {
+ 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* SVGLinearGradientElement::createLayoutObject(const ComputedStyle&)

Powered by Google App Engine
This is Rietveld 408576698