Chromium Code Reviews| Index: Source/core/svg/SVGRectElement.cpp |
| diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp |
| index 940a2f4977a45b529aaf1f178e98aaf1109e23b3..e412836d9b4b382154be11fb6ca1768fcbc259fe 100644 |
| --- a/Source/core/svg/SVGRectElement.cpp |
| +++ b/Source/core/svg/SVGRectElement.cpp |
| @@ -78,6 +78,7 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin |
| bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) const |
| { |
| if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr |
| + || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr |
| || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) |
| return true; |
| return SVGGeometryElement::isPresentationAttribute(attrName); |
| @@ -86,6 +87,7 @@ bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) cons |
| bool SVGRectElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attrName) const |
| { |
| if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr |
| + || attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr |
| || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr) |
| return true; |
| return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); |
| @@ -98,6 +100,10 @@ void SVGRectElement::collectStyleForPresentationAttribute(const QualifiedName& n |
| addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyX, *m_x->currentValue()); |
| else if (property == m_y) |
| addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyY, *m_y->currentValue()); |
| + else if (property == m_width) |
| + addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyWidth, *m_width->currentValue()); |
| + else if (property == m_height) |
| + addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyHeight, *m_height->currentValue()); |
| else if (property == m_rx) |
| addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRx, *m_rx->currentValue()); |
| else if (property == m_ry) |
| @@ -115,35 +121,18 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) |
| SVGElement::InvalidationGuard invalidationGuard(this); |
| - bool isPresentationLengthAttribute = |
| - attrName == SVGNames::xAttr |
| - || attrName == SVGNames::yAttr |
| - || attrName == SVGNames::rxAttr |
| - || attrName == SVGNames::ryAttr; |
| - if (isPresentationLengthAttribute) { |
| - invalidateSVGPresentationAttributeStyle(); |
| - setNeedsStyleRecalc(LocalStyleChange, |
| - StyleChangeReasonForTracing::fromAttribute(attrName)); |
| - } |
| - |
| - bool isLengthAttribute = isPresentationLengthAttribute |
| - || attrName == SVGNames::widthAttr |
| - || attrName == SVGNames::heightAttr; |
| - |
| - if (isLengthAttribute) |
| - updateRelativeLengthsInformation(); |
| + ASSERT(isSupportedAttribute(attrName)); |
|
fs
2015/03/12 14:28:48
Probably not the most enlightening assert as long
Erik Dahlström (inactive)
2015/03/12 16:14:56
I'm not sure the assert is very useful, it was an
fs
2015/03/12 16:40:07
I'm fine with dropping the assert altogether. The
Erik Dahlström (inactive)
2015/03/13 09:16:23
Dropped in patchset #5.
|
| + invalidateSVGPresentationAttributeStyle(); |
| + setNeedsStyleRecalc(LocalStyleChange, |
| + StyleChangeReasonForTracing::fromAttribute(attrName)); |
| + updateRelativeLengthsInformation(); |
| LayoutSVGShape* renderer = toLayoutSVGShape(this->layoutObject()); |
| if (!renderer) |
| return; |
| - if (isLengthAttribute) { |
| - renderer->setNeedsShapeUpdate(); |
| - markForLayoutAndParentResourceInvalidation(renderer); |
| - return; |
| - } |
| - |
| - ASSERT_NOT_REACHED(); |
| + renderer->setNeedsShapeUpdate(); |
| + markForLayoutAndParentResourceInvalidation(renderer); |
| } |
| bool SVGRectElement::selfHasRelativeLengths() const |