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

Unified Diff: Source/core/svg/SVGLineElement.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/SVGLineElement.cpp
diff --git a/Source/core/svg/SVGLineElement.cpp b/Source/core/svg/SVGLineElement.cpp
index f774cd46c6f779ee9a71b10fbe89c1da3159f885..44a129c53a53d5d187e4d00164527c764430ccfb 100644
--- a/Source/core/svg/SVGLineElement.cpp
+++ b/Source/core/svg/SVGLineElement.cpp
@@ -50,27 +50,8 @@ 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
@@ -79,17 +60,19 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject());
- if (!renderer)
- return;
-
if (isLengthAttribute) {
fs 2015/04/10 14:25:24 Merge blocks.
- renderer->setNeedsShapeUpdate();
- markForLayoutAndParentResourceInvalidation(renderer);
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ LayoutSVGShape* object = toLayoutSVGShape(this->layoutObject());
+ if (!object)
+ return;
+
+ object->setNeedsShapeUpdate();
+ markForLayoutAndParentResourceInvalidation(object);
return;
}
- ASSERT_NOT_REACHED();
+ SVGGeometryElement::svgAttributeChanged(attrName);
}
bool SVGLineElement::selfHasRelativeLengths() const

Powered by Google App Engine
This is Rietveld 408576698