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

Unified Diff: Source/core/svg/SVGRectElement.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/SVGRectElement.cpp
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp
index f3ec3367d60823a475fc226bb6585c9f350a53fb..7492b05b7e41142ee21931fb03f8d88fb62fe066 100644
--- a/Source/core/svg/SVGRectElement.cpp
+++ b/Source/core/svg/SVGRectElement.cpp
@@ -56,20 +56,6 @@ DEFINE_TRACE(SVGRectElement)
DEFINE_NODE_FACTORY(SVGRectElement)
-bool SVGRectElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- supportedAttributes.add(SVGNames::widthAttr);
- supportedAttributes.add(SVGNames::heightAttr);
- supportedAttributes.add(SVGNames::rxAttr);
- supportedAttributes.add(SVGNames::ryAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) const
{
if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
@@ -109,24 +95,27 @@ void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n
void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGeometryElement::svgAttributeChanged(attrName);
- return;
- }
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
+ || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr
+ || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
- SVGElement::InvalidationGuard invalidationGuard(this);
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
+ updateRelativeLengthsInformation();
- invalidateSVGPresentationAttributeStyle();
- setNeedsStyleRecalc(LocalStyleChange,
- StyleChangeReasonForTracing::fromAttribute(attrName));
- updateRelativeLengthsInformation();
+ LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
+ if (!renderer)
+ return;
+
+ renderer->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(renderer);
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- if (!renderer)
return;
+ }
- renderer->setNeedsShapeUpdate();
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
bool SVGRectElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698