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

Unified Diff: Source/core/svg/SVGEllipseElement.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/SVGEllipseElement.cpp
diff --git a/Source/core/svg/SVGEllipseElement.cpp b/Source/core/svg/SVGEllipseElement.cpp
index 1527c918915912aef2038c2f6a147df257955855..1b3418f7049b8b33d0ffbe7a01ceafeb1d9176e6 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -50,18 +50,6 @@ DEFINE_TRACE(SVGEllipseElement)
DEFINE_NODE_FACTORY(SVGEllipseElement)
-bool SVGEllipseElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::cxAttr);
- supportedAttributes.add(SVGNames::cyAttr);
- supportedAttributes.add(SVGNames::rxAttr);
- supportedAttributes.add(SVGNames::ryAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
bool SVGEllipseElement::isPresentationAttribute(const QualifiedName& attrName) const
{
if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
@@ -96,24 +84,30 @@ void SVGEllipseElement::collectStyleForPresentationAttribute(const QualifiedName
void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGeometryElement::svgAttributeChanged(attrName);
- return;
- }
-
SVGElement::InvalidationGuard invalidationGuard(this);
- invalidateSVGPresentationAttributeStyle();
- setNeedsStyleRecalc(LocalStyleChange,
- StyleChangeReasonForTracing::fromAttribute(attrName));
- updateRelativeLengthsInformation();
+ bool lengthAttrs =
+ attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
+ || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr;
+
+ if (lengthAttrs) {
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
+ updateRelativeLengthsInformation();
+ }
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- if (!renderer)
+ if (lengthAttrs) {
fs 2015/04/10 14:25:24 Join these two blocks, and then put the Invalidati
Erik Dahlström (inactive) 2015/04/10 15:33:44 Done.
+ LayoutSVGShape* object = toLayoutSVGShape(this->layoutObject());
+ if (!object)
+ return;
+
+ object->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(object);
return;
+ }
- renderer->setNeedsShapeUpdate();
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
bool SVGEllipseElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698