Index: Source/core/svg/SVGForeignObjectElement.cpp |
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp |
index abf120afb2cede70aaf1200b708f11475464cdf5..a588a67984e325a1d144c468e5b4c0d1da6350c1 100644 |
--- a/Source/core/svg/SVGForeignObjectElement.cpp |
+++ b/Source/core/svg/SVGForeignObjectElement.cpp |
@@ -85,6 +85,29 @@ void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At |
reportAttributeParsingError(parseError, name, value); |
} |
+bool SVGForeignObjectElement::isPresentationAttribute(const QualifiedName& name) const |
+{ |
+ if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) |
+ return true; |
+ return SVGGraphicsElement::isPresentationAttribute(name); |
+} |
+ |
+void SVGForeignObjectElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) |
+{ |
+ if (name == SVGNames::widthAttr || name == SVGNames::heightAttr) { |
+ RefPtr<SVGLength> length = SVGLength::create(LengthModeOther); |
+ length->setValueAsString(value, IGNORE_EXCEPTION); |
+ if (length->unitType() != LengthTypeUnknown) { |
+ if (name == SVGNames::widthAttr) |
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, length->valueAsString()); |
+ else if (name == SVGNames::heightAttr) |
+ addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, length->valueAsString()); |
+ } |
+ } else { |
+ SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style); |
+ } |
+} |
+ |
void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) |
{ |
if (!isSupportedAttribute(attrName)) { |
@@ -92,6 +115,11 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) |
return; |
} |
+ if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { |
+ invalidateSVGPresentationAttributeStyle(); |
+ setNeedsStyleRecalc(LocalStyleChange); |
+ } |
+ |
SVGElementInstance::InvalidationGuard invalidationGuard(this); |
bool isLengthAttribute = attrName == SVGNames::xAttr |