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

Unified Diff: Source/core/svg/SVGForeignObjectElement.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/SVGForeignObjectElement.cpp
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp
index ce576e8d3c9a3db58f9018a9b3705feda78dcff8..5181ab89732b0890701b978f6dfba9f05e3898d6 100644
--- a/Source/core/svg/SVGForeignObjectElement.cpp
+++ b/Source/core/svg/SVGForeignObjectElement.cpp
@@ -55,18 +55,6 @@ DEFINE_TRACE(SVGForeignObjectElement)
DEFINE_NODE_FACTORY(SVGForeignObjectElement)
-bool SVGForeignObjectElement::isSupportedAttribute(const QualifiedName& attrName)
-{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
- if (supportedAttributes.isEmpty()) {
- supportedAttributes.add(SVGNames::xAttr);
- supportedAttributes.add(SVGNames::yAttr);
- supportedAttributes.add(SVGNames::widthAttr);
- supportedAttributes.add(SVGNames::heightAttr);
- }
- return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
-}
-
bool SVGForeignObjectElement::isPresentationAttribute(const QualifiedName& name) const
{
if (name == SVGNames::xAttr || name == SVGNames::yAttr
@@ -100,18 +88,13 @@ void SVGForeignObjectElement::collectStyleForPresentationAttribute(const Qualifi
void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
{
- if (!isSupportedAttribute(attrName)) {
- SVGGraphicsElement::svgAttributeChanged(attrName);
- return;
- }
-
- SVGElement::InvalidationGuard invalidationGuard(this);
-
bool isWidthHeightAttribute = attrName == SVGNames::widthAttr
|| attrName == SVGNames::heightAttr;
bool isXYAttribute = attrName == SVGNames::xAttr || attrName == SVGNames::yAttr;
if (isXYAttribute || isWidthHeightAttribute) {
+ SVGElement::InvalidationGuard invalidationGuard(this);
+
invalidateSVGPresentationAttributeStyle();
setNeedsStyleRecalc(LocalStyleChange,
isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleChangeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute(attrName));
@@ -119,7 +102,11 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
updateRelativeLengthsInformation();
if (LayoutObject* renderer = this->layoutObject())
markForLayoutAndParentResourceInvalidation(renderer);
+
+ return;
}
+
+ SVGGraphicsElement::svgAttributeChanged(attrName);
}
LayoutObject* SVGForeignObjectElement::createLayoutObject(const ComputedStyle&)

Powered by Google App Engine
This is Rietveld 408576698