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

Unified Diff: Source/core/svg/SVGImageElement.cpp

Issue 1074813002: Remove isSupportedAttribute in svg (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review fixes 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
« no previous file with comments | « Source/core/svg/SVGImageElement.h ('k') | Source/core/svg/SVGLineElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGImageElement.cpp
diff --git a/Source/core/svg/SVGImageElement.cpp b/Source/core/svg/SVGImageElement.cpp
index e1197b20bed74499a94f4a134c4440879f22b192..76b3e16501feef6069a0ded545144025842ef65b 100644
--- a/Source/core/svg/SVGImageElement.cpp
+++ b/Source/core/svg/SVGImageElement.cpp
@@ -74,20 +74,6 @@ bool SVGImageElement::currentFrameHasSingleSecurityOrigin() const
return true;
}
-bool SVGImageElement::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);
- supportedAttributes.add(SVGNames::preserveAspectRatioAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
bool SVGImageElement::isPresentationAttribute(const QualifiedName& attrName) const
{
if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
@@ -122,13 +108,6 @@ void SVGImageElement::collectStyleForPresentationAttribute(const QualifiedName&
void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGraphicsElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
bool isLengthAttribute = attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::widthAttr
@@ -141,28 +120,31 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
updateRelativeLengthsInformation();
pdr. 2015/04/10 18:39:21 Does this path need to be covered by the invalidat
Erik Dahlström (inactive) 2015/04/13 08:11:17 Hmm, yes I think it should be covered by that. I h
}
- if (SVGURIReference::isKnownAttribute(attrName)) {
- if (inDocument())
- imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousError);
- else
- m_needsLoaderURIUpdate = true;
- return;
- }
+ if (isLengthAttribute || attrName == SVGNames::preserveAspectRatioAttr) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
- LayoutObject* renderer = this->layoutObject();
- if (!renderer)
- return;
+ LayoutObject* object = this->layoutObject();
+ if (!object)
+ return;
- if (isLengthAttribute || attrName == SVGNames::preserveAspectRatioAttr) {
// FIXME: if isLengthAttribute then we should avoid this
// call if the viewport didn't change, however since we don't
// have the computed style yet we can't use updateImageViewport.
// See http://crbug.com/466200.
- markForLayoutAndParentResourceInvalidation(renderer);
+ markForLayoutAndParentResourceInvalidation(object);
+ return;
+ }
+
+ if (SVGURIReference::isKnownAttribute(attrName)) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+ if (inDocument())
+ imageLoader().updateFromElement(ImageLoader::UpdateIgnorePreviousError);
+ else
+ m_needsLoaderURIUpdate = true;
return;
}
- ASSERT_NOT_REACHED();
+ SVGGraphicsElement::svgAttributeChanged(attrName);
}
bool SVGImageElement::selfHasRelativeLengths() const
« no previous file with comments | « Source/core/svg/SVGImageElement.h ('k') | Source/core/svg/SVGLineElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698