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

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

Issue 955033002: [svg2] Make 'rx' and 'ry' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review fixes Created 5 years, 10 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/SVGRectElement.h ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGRectElement.cpp
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp
index aabdb2312ce3a1d7a9cf007683afcf55fe1cb9c5..93892a525bcc182ab938168a8f95c86282140886 100644
--- a/Source/core/svg/SVGRectElement.cpp
+++ b/Source/core/svg/SVGRectElement.cpp
@@ -77,14 +77,16 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin
bool SVGRectElement::isPresentationAttribute(const QualifiedName& attrName) const
{
- if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
+ || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
return true;
return SVGGeometryElement::isPresentationAttribute(attrName);
}
bool SVGRectElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attrName) const
{
- if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr)
+ if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr
+ || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
return true;
return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName);
}
@@ -96,6 +98,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_rx)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRx, *m_rx->currentValue());
+ else if (property == m_ry)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRy, *m_ry->currentValue());
else
SVGGeometryElement::collectStyleForPresentationAttribute(name, value, style);
}
@@ -109,20 +115,20 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
SVGElement::InvalidationGuard invalidationGuard(this);
- bool isLengthAttributeXY =
+ bool isPresentationLengthAttribute =
attrName == SVGNames::xAttr
- || attrName == SVGNames::yAttr;
- if (isLengthAttributeXY) {
+ || attrName == SVGNames::yAttr
+ || attrName == SVGNames::rxAttr
+ || attrName == SVGNames::ryAttr;
+ if (isPresentationLengthAttribute) {
invalidateSVGPresentationAttributeStyle();
setNeedsStyleRecalc(LocalStyleChange,
StyleChangeReasonForTracing::fromAttribute(attrName));
}
- bool isLengthAttribute = isLengthAttributeXY
- || attrName == SVGNames::widthAttr
- || attrName == SVGNames::heightAttr
- || attrName == SVGNames::rxAttr
- || attrName == SVGNames::ryAttr;
+ bool isLengthAttribute = isPresentationLengthAttribute
+ || attrName == SVGNames::widthAttr
+ || attrName == SVGNames::heightAttr;
if (isLengthAttribute)
updateRelativeLengthsInformation();
« no previous file with comments | « Source/core/svg/SVGRectElement.h ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698