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

Unified Diff: Source/core/svg/SVGTextPathElement.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/SVGTextPathElement.cpp
diff --git a/Source/core/svg/SVGTextPathElement.cpp b/Source/core/svg/SVGTextPathElement.cpp
index c83bd93dfb660fca627376f31e8530b99fc28ad1..c40715f35cf9741b1c3529750f103efeabd92936 100644
--- a/Source/core/svg/SVGTextPathElement.cpp
+++ b/Source/core/svg/SVGTextPathElement.cpp
@@ -82,28 +82,10 @@ void SVGTextPathElement::clearResourceReferences()
removeAllOutgoingReferences();
}
-bool SVGTextPathElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::startOffsetAttr);
- supportedAttributes.add(SVGNames::methodAttr);
- supportedAttributes.add(SVGNames::spacingAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGTextContentElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
if (SVGURIReference::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
buildPendingResource();
return;
}
@@ -111,8 +93,17 @@ void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName)
if (attrName == SVGNames::startOffsetAttr)
updateRelativeLengthsInformation();
- if (LayoutObject* object = layoutObject())
- markForLayoutAndParentResourceInvalidation(object);
+ if (attrName == SVGNames::startOffsetAttr
+ || attrName == SVGNames::methodAttr
+ || attrName == SVGNames::spacingAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+ if (LayoutObject* object = layoutObject())
+ markForLayoutAndParentResourceInvalidation(object);
+
+ return;
+ }
+
+ SVGTextContentElement::svgAttributeChanged(attrName);
}
LayoutObject* SVGTextPathElement::createLayoutObject(const ComputedStyle&)

Powered by Google App Engine
This is Rietveld 408576698