Chromium Code Reviews| Index: Source/core/svg/SVGForeignObjectElement.cpp |
| diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp |
| index bec8dffa6e725da594135066e6d035387972de73..3fb5c834201dbc31b58af4ba2db299f2684ae97f 100644 |
| --- a/Source/core/svg/SVGForeignObjectElement.cpp |
| +++ b/Source/core/svg/SVGForeignObjectElement.cpp |
| @@ -82,6 +82,25 @@ 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) { |
|
fs
2014/04/02 11:00:41
It seems unnecessary to check these twice (for no
davve
2014/04/02 11:17:48
Thanks. Was remains from earlier versions.
|
| + if (name == SVGNames::widthAttr) |
| + addPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, m_width->currentValue()->valueAsString()); |
|
fs
2014/04/02 11:00:41
Why not just pass |value| as the value? (IIUC, if
davve
2014/04/02 11:17:48
I specifically added a test that fails when using
fs
2014/04/02 11:55:00
Ok. I figured that's what the change in svgAttribu
davve
2014/04/02 12:43:56
It is. But it only triggers the recomputation, doe
|
| + else if (name == SVGNames::heightAttr) |
| + addPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, m_height->currentValue()->valueAsString()); |
| + } else { |
| + SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style); |
| + } |
| +} |
| + |
| void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) |
| { |
| if (!isSupportedAttribute(attrName)) { |
| @@ -89,6 +108,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 |