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

Unified Diff: Source/core/svg/SVGFilterElement.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/SVGFilterElement.cpp
diff --git a/Source/core/svg/SVGFilterElement.cpp b/Source/core/svg/SVGFilterElement.cpp
index 1e14544ae9e2cf7b5f9962e12992f94ad68a92a5..2ae0f07bcd7ea1a079e819915e6dd9c29192597c 100644
--- a/Source/core/svg/SVGFilterElement.cpp
+++ b/Source/core/svg/SVGFilterElement.cpp
@@ -86,31 +86,8 @@ void SVGFilterElement::setFilterRes(unsigned x, unsigned y)
svgAttributeChanged(SVGNames::filterResAttr);
}
-bool SVGFilterElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::filterUnitsAttr);
- supportedAttributes.add(SVGNames::primitiveUnitsAttr);
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- supportedAttributes.add(SVGNames::widthAttr);
- supportedAttributes.add(SVGNames::heightAttr);
- supportedAttributes.add(SVGNames::filterResAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
bool isXYWH = attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::widthAttr
@@ -120,9 +97,19 @@ void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
else if (attrName == SVGNames::filterResAttr)
UseCounter::count(document(), UseCounter::SVGFilterRes);
- LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
- if (renderer)
- renderer->invalidateCacheAndMarkForLayout();
+ if (isXYWH
+ || attrName == SVGNames::filterResAttr
+ || attrName == SVGNames::filterUnitsAttr
+ || attrName == SVGNames::primitiveUnitsAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+ LayoutSVGResourceContainer* renderer = toLayoutSVGResourceContainer(this->layoutObject());
+ if (renderer)
+ renderer->invalidateCacheAndMarkForLayout();
+
+ return;
+ }
+
+ SVGElement::svgAttributeChanged(attrName);
}
void SVGFilterElement::childrenChanged(const ChildrenChange& change)

Powered by Google App Engine
This is Rietveld 408576698