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

Unified Diff: Source/core/svg/SVGCircleElement.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/SVGCircleElement.cpp
diff --git a/Source/core/svg/SVGCircleElement.cpp b/Source/core/svg/SVGCircleElement.cpp
index 10402a942a35776af0cc69c312703a77405f0999..78899daa289067a48a611f2dcc88e8528dad42e5 100644
--- a/Source/core/svg/SVGCircleElement.cpp
+++ b/Source/core/svg/SVGCircleElement.cpp
@@ -47,17 +47,6 @@ DEFINE_TRACE(SVGCircleElement)
DEFINE_NODE_FACTORY(SVGCircleElement)
-bool SVGCircleElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::cxAttr);
- supportedAttributes.add(SVGNames::cyAttr);
- supportedAttributes.add(SVGNames::rAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
bool SVGCircleElement::isPresentationAttribute(const QualifiedName& attrName) const
{
if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
@@ -89,24 +78,26 @@ void SVGCircleElement::collectStyleForPresentationAttribute(const QualifiedName&
void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGeometryElement::svgAttributeChanged(attrName);
+ if (attrName == SVGNames::rAttr
+ || attrName == SVGNames::cxAttr
+ || attrName == SVGNames::cyAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
+ updateRelativeLengthsInformation();
+
+ LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
+ if (!renderer)
+ return;
+
+ renderer->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(renderer);
return;
}
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- invalidateSVGPresentationAttributeStyle();
- setNeedsStyleRecalc(LocalStyleChange,
- StyleChangeReasonForTracing::fromAttribute(attrName));
- updateRelativeLengthsInformation();
-
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- if (!renderer)
- return;
-
- renderer->setNeedsShapeUpdate();
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGGraphicsElement::svgAttributeChanged(attrName);
}
bool SVGCircleElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698