Chromium Code Reviews| Index: Source/core/svg/SVGTextPositioningElement.cpp |
| diff --git a/Source/core/svg/SVGTextPositioningElement.cpp b/Source/core/svg/SVGTextPositioningElement.cpp |
| index 4c6a02e2c2692266a242d9d0db090b52fd0ac793..43f7b83a58d66a04176e7cfa74d1f2c6b857c299 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,21 @@ 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); |
| + |
| + LayoutObject* renderer = this->layoutObject(); |
| + if (!renderer) |
| + return; |
| - ASSERT(updateRelativeLengths || attrName == SVGNames::rotateAttr); |
| + if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor(renderer)) |
| + textRenderer->setNeedsPositioningValuesUpdate(); |
| + markForLayoutAndParentResourceInvalidation(renderer); |
| + |
|
fs
2015/04/10 14:25:24
Drop.
Erik Dahlström (inactive)
2015/04/10 15:33:44
Done.
|
| + return; |
| + } |
| - if (LayoutSVGText* textRenderer = LayoutSVGText::locateLayoutSVGTextAncestor(renderer)) |
| - textRenderer->setNeedsPositioningValuesUpdate(); |
| - markForLayoutAndParentResourceInvalidation(renderer); |
| + SVGTextContentElement::svgAttributeChanged(attrName); |
| } |
| SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(LayoutObject& renderer) |