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

Unified Diff: Source/core/svg/SVGLineElement.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/SVGLineElement.cpp
diff --git a/Source/core/svg/SVGLineElement.cpp b/Source/core/svg/SVGLineElement.cpp
index f774cd46c6f779ee9a71b10fbe89c1da3159f885..040203b264ae2702f3f273632711782b62b39d1b 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* renderer = toLayoutSVGShape(this->layoutObject());
+ if (!renderer)
+ return;
- if (isLengthAttribute) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
renderer->setNeedsShapeUpdate();
markForLayoutAndParentResourceInvalidation(renderer);
return;
}
- ASSERT_NOT_REACHED();
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
bool SVGLineElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698