Index: Source/core/svg/SVGTextPositioningElement.cpp |
diff --git a/Source/core/svg/SVGTextPositioningElement.cpp b/Source/core/svg/SVGTextPositioningElement.cpp |
index 4c6a02e2c2692266a242d9d0db090b52fd0ac793..49d2778fd58dd3e6a2bd4333b73aae5676423911 100644 |
--- a/Source/core/svg/SVGTextPositioningElement.cpp |
+++ b/Source/core/svg/SVGTextPositioningElement.cpp |
@@ -54,28 +54,8 @@ DEFINE_TRACE(SVGTextPositioningElement) |
SVGTextContentElement::trace(visitor); |
} |
-bool SVGTextPositioningElement::isSupportedAttribute(const QualifiedName& attrName) |
-{ |
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
- if (supportedAttributes.isEmpty()) { |
- supportedAttributes.add(SVGNames::xAttr); |
- supportedAttributes.add(SVGNames::yAttr); |
- supportedAttributes.add(SVGNames::dxAttr); |
- supportedAttributes.add(SVGNames::dyAttr); |
- supportedAttributes.add(SVGNames::rotateAttr); |
- } |
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
-} |
- |
void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName) |
{ |
- if (!isSupportedAttribute(attrName)) { |
- SVGTextContentElement::svgAttributeChanged(attrName); |
- return; |
- } |
- |
- SVGElement::InvalidationGuard invalidationGuard(this); |
- |
bool updateRelativeLengths = attrName == SVGNames::xAttr |
|| attrName == SVGNames::yAttr |
|| attrName == SVGNames::dxAttr |
@@ -84,15 +64,20 @@ void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam |
if (updateRelativeLengths) |
updateRelativeLengthsInformation(); |
- LayoutObject* renderer = this->layoutObject(); |
- if (!renderer) |
- return; |
+ if (updateRelativeLengths || attrName == SVGNames::rotateAttr) { |
+ SVGElement::InvalidationGuard invalidationGuard(this); |
- ASSERT(updateRelativeLengths || attrName == SVGNames::rotateAttr); |
+ LayoutObject* renderer = this->layoutObject(); |
+ if (!renderer) |
+ return; |
+ |
+ if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor(renderer)) |
+ textRenderer->setNeedsPositioningValuesUpdate(); |
+ markForLayoutAndParentResourceInvalidation(renderer); |
+ return; |
+ } |
- if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor(renderer)) |
- textRenderer->setNeedsPositioningValuesUpdate(); |
- markForLayoutAndParentResourceInvalidation(renderer); |
+ SVGTextContentElement::svgAttributeChanged(attrName); |
} |
SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(LayoutObject& renderer) |