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

Unified Diff: Source/core/svg/SVGLineElement.cpp

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review fixes 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/SVGLineElement.cpp
diff --git a/Source/core/svg/SVGLineElement.cpp b/Source/core/svg/SVGLineElement.cpp
index f774cd46c6f779ee9a71b10fbe89c1da3159f885..2b62bf41ab4a4c0b166a712659d5ffe4bc1d3141 100644
--- a/Source/core/svg/SVGLineElement.cpp
+++ b/Source/core/svg/SVGLineElement.cpp
@@ -50,46 +50,25 @@ DEFINE_TRACE(SVGLineElement)
DEFINE_NODE_FACTORY(SVGLineElement)
-bool SVGLineElement::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 SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGeometryElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- bool isLengthAttribute = attrName == SVGNames::x1Attr
- || attrName == SVGNames::y1Attr
- || attrName == SVGNames::x2Attr
- || attrName == SVGNames::y2Attr;
-
- if (isLengthAttribute)
+ if (attrName == SVGNames::x1Attr
+ || attrName == SVGNames::y1Attr
+ || attrName == SVGNames::x2Attr
+ || attrName == SVGNames::y2Attr) {
updateRelativeLengthsInformation();
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- if (!renderer)
- return;
+ LayoutSVGShape* object = toLayoutSVGShape(this->layoutObject());
+ if (!object)
+ return;
- if (isLengthAttribute) {
- renderer->setNeedsShapeUpdate();
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGElement::InvalidationGuard invalidationGuard(this);
+ object->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(object);
return;
}
- ASSERT_NOT_REACHED();
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
bool SVGLineElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698