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

Unified Diff: Source/core/svg/SVGCursorElement.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/SVGCursorElement.cpp
diff --git a/Source/core/svg/SVGCursorElement.cpp b/Source/core/svg/SVGCursorElement.cpp
index 2111998d431e942c94d24bd1d3f63e888a6b40f6..c2290eb0e242e2ef4b7dd358f911f2cffd2f7700 100644
--- a/Source/core/svg/SVGCursorElement.cpp
+++ b/Source/core/svg/SVGCursorElement.cpp
@@ -49,18 +49,6 @@ SVGCursorElement::~SVGCursorElement()
#endif
}
-bool SVGCursorElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGTests::addSupportedAttributes(supportedAttributes);
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
void SVGCursorElement::addClient(SVGElement* element)
{
m_clients.add(element);
@@ -85,16 +73,19 @@ void SVGCursorElement::removeReferencedElement(SVGElement* element)
void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGElement::svgAttributeChanged(attrName);
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
+ || SVGTests::isKnownAttribute(attrName)
+ || SVGURIReference::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
+ // Any change of a cursor specific attribute triggers this recalc.
+ for (const auto& client : m_clients)
+ client->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SVGCursor));
+
return;
}
- SVGElement::InvalidationGuard invalidationGuard(this);
-
- // Any change of a cursor specific attribute triggers this recalc.
- for (const auto& client : m_clients)
- client->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::SVGCursor));
+ SVGElement::svgAttributeChanged(attrName);
}
DEFINE_TRACE(SVGCursorElement)

Powered by Google App Engine
This is Rietveld 408576698