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

Unified Diff: Source/core/svg/SVGMarkerElement.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/SVGMarkerElement.cpp
diff --git a/Source/core/svg/SVGMarkerElement.cpp b/Source/core/svg/SVGMarkerElement.cpp
index 053c315b5a47ac228868c9e071bcf436f0a90875..c2bae7ea1ee9996ec8c1f0ca1bb21315c8d6aaeb 100644
--- a/Source/core/svg/SVGMarkerElement.cpp
+++ b/Source/core/svg/SVGMarkerElement.cpp
@@ -81,39 +81,28 @@ AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
return SVGFitToViewBox::viewBoxToViewTransform(viewBox()->currentValue()->value(), preserveAspectRatio()->currentValue(), viewWidth, viewHeight);
}
-bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGFitToViewBox::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::markerUnitsAttr);
- supportedAttributes.add(SVGNames::refXAttr);
- supportedAttributes.add(SVGNames::refYAttr);
- supportedAttributes.add(SVGNames::markerWidthAttr);
- supportedAttributes.add(SVGNames::markerHeightAttr);
- supportedAttributes.add(SVGNames::orientAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- if (attrName == SVGNames::refXAttr
+ bool isLengthAttr = attrName == SVGNames::refXAttr
|| attrName == SVGNames::refYAttr
|| attrName == SVGNames::markerWidthAttr
- || attrName == SVGNames::markerHeightAttr)
+ || attrName == SVGNames::markerHeightAttr;
+
+ if (isLengthAttr)
updateRelativeLengthsInformation();
- LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
- if (renderer)
- renderer->invalidateCacheAndMarkForLayout();
+ if (isLengthAttr || attrName == SVGNames::markerUnitsAttr
+ || attrName == SVGNames::orientAttr
+ || SVGFitToViewBox::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+ LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
+ if (renderer)
+ renderer->invalidateCacheAndMarkForLayout();
+
+ return;
+ }
+
+ SVGElement::svgAttributeChanged(attrName);
}
void SVGMarkerElement::childrenChanged(const ChildrenChange& change)

Powered by Google App Engine
This is Rietveld 408576698