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) |