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

Unified Diff: Source/core/svg/SVGPatternElement.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/SVGPatternElement.cpp
diff --git a/Source/core/svg/SVGPatternElement.cpp b/Source/core/svg/SVGPatternElement.cpp
index 6494a5512ed126ef1d7d0f681c943a18d9733f9e..2c2315aeb16315d06a59b244124816f4b8a56062 100644
--- a/Source/core/svg/SVGPatternElement.cpp
+++ b/Source/core/svg/SVGPatternElement.cpp
@@ -69,42 +69,33 @@ DEFINE_TRACE(SVGPatternElement)
DEFINE_NODE_FACTORY(SVGPatternElement)
-bool SVGPatternElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- SVGTests::addSupportedAttributes(supportedAttributes);
- SVGFitToViewBox::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::patternUnitsAttr);
- supportedAttributes.add(SVGNames::patternContentUnitsAttr);
- supportedAttributes.add(SVGNames::patternTransformAttr);
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- supportedAttributes.add(SVGNames::widthAttr);
- supportedAttributes.add(SVGNames::heightAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- if (attrName == SVGNames::xAttr
+ bool isLengthAttr = attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::widthAttr
- || attrName == SVGNames::heightAttr)
- updateRelativeLengthsInformation();
+ || attrName == SVGNames::heightAttr;
+
+ if (isLengthAttr
+ || attrName == SVGNames::patternUnitsAttr
+ || attrName == SVGNames::patternContentUnitsAttr
+ || attrName == SVGNames::patternTransformAttr
+ || SVGFitToViewBox::isKnownAttribute(attrName)
+ || SVGURIReference::isKnownAttribute(attrName)
+ || SVGTests::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ if (isLengthAttr)
+ updateRelativeLengthsInformation();
+
+ LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
+ if (renderer)
+ renderer->invalidateCacheAndMarkForLayout();
+
+ return;
+ }
- LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
- if (renderer)
- renderer->invalidateCacheAndMarkForLayout();
+ SVGElement::svgAttributeChanged(attrName);
}
void SVGPatternElement::childrenChanged(const ChildrenChange& change)

Powered by Google App Engine
This is Rietveld 408576698