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

Unified Diff: Source/core/svg/SVGUseElement.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/SVGUseElement.cpp
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index 82cd6e5d1529534f7b7103a9f1dbb35322a7eef1..a1bce4ce3a2fe29ae5788f7ad34e0d3e2a167b59 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -89,19 +89,6 @@ DEFINE_TRACE(SVGUseElement)
SVGURIReference::trace(visitor);
}
-bool SVGUseElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- SVGURIReference::addSupportedAttributes(supportedAttributes);
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- supportedAttributes.add(SVGNames::widthAttr);
- supportedAttributes.add(SVGNames::heightAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
#if ENABLE(ASSERT)
static inline bool isWellFormedDocument(Document* document)
{
@@ -203,13 +190,6 @@ void SVGUseElement::collectStyleForPresentationAttribute(const QualifiedName& na
void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGraphicsElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
if (attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr) {
invalidateSVGPresentationAttributeStyle();
@@ -222,6 +202,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::widthAttr
|| attrName == SVGNames::heightAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
updateRelativeLengthsInformation();
if (m_targetElementInstance) {
ASSERT(m_targetElementInstance->correspondingElement());
@@ -233,6 +214,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
}
if (SVGURIReference::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
bool isExternalReference = isExternalURIReference(hrefString(), document());
if (isExternalReference) {
KURL url = document().completeURL(hrefString());
@@ -249,10 +231,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
return;
}
- if (!renderer)
- return;
-
- ASSERT_NOT_REACHED();
+ SVGGraphicsElement::svgAttributeChanged(attrName);
}
static bool isDisallowedElement(Node* node)

Powered by Google App Engine
This is Rietveld 408576698