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

Unified Diff: Source/core/svg/SVGTextPositioningElement.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/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)

Powered by Google App Engine
This is Rietveld 408576698