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

Unified Diff: Source/core/svg/SVGPathElement.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/SVGPathElement.cpp
diff --git a/Source/core/svg/SVGPathElement.cpp b/Source/core/svg/SVGPathElement.cpp
index 052a153e1d1ff58c513a15f0320438048dea68be..92ec8b5073117607b1cc04ac59a04e1a0b5ce55a 100644
--- a/Source/core/svg/SVGPathElement.cpp
+++ b/Source/core/svg/SVGPathElement.cpp
@@ -200,36 +200,27 @@ PassRefPtrWillBeRawPtr<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::crea
return SVGPathSegCurvetoQuadraticSmoothRel::create(0, x, y);
}
-bool SVGPathElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::dAttr);
- supportedAttributes.add(SVGNames::pathLengthAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGeometryElement::svgAttributeChanged(attrName);
- return;
- }
+ if (attrName == SVGNames::dAttr || attrName == SVGNames::pathLengthAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
- SVGElement::InvalidationGuard invalidationGuard(this);
+ LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
+ if (attrName == SVGNames::dAttr) {
+ if (renderer)
+ renderer->setNeedsShapeUpdate();
+
+ invalidateMPathDependencies();
+ }
- if (attrName == SVGNames::dAttr) {
if (renderer)
- renderer->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(renderer);
- invalidateMPathDependencies();
+ return;
}
- if (renderer)
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
void SVGPathElement::invalidateMPathDependencies()

Powered by Google App Engine
This is Rietveld 408576698