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

Unified Diff: Source/core/svg/SVGEllipseElement.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/SVGEllipseElement.h ('k') | Source/core/svg/SVGRectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGEllipseElement.cpp
diff --git a/Source/core/svg/SVGEllipseElement.cpp b/Source/core/svg/SVGEllipseElement.cpp
index 0c428a643b00bac9ecabcac5a9bf4d53bbc3cfb3..ca8f1a605af6848d0b7328e46c05064c425e7bf0 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -67,6 +67,32 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
parseAttributeNew(name, value);
}
+bool SVGEllipseElement::isPresentationAttribute(const QualifiedName& attrName) const
+{
+ if (attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
+ return true;
+ return SVGGeometryElement::isPresentationAttribute(attrName);
+}
+
+bool SVGEllipseElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attrName) const
+{
+ if (attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
+ return true;
+ return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName);
+}
+
+void SVGEllipseElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
+{
+ RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
+ 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);
+}
+
+
void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
@@ -76,10 +102,18 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
SVGElement::InvalidationGuard invalidationGuard(this);
+ bool isPresentationLengthAttribute =
+ attrName == SVGNames::rxAttr
+ || attrName == SVGNames::ryAttr;
+ if (isPresentationLengthAttribute) {
+ invalidateSVGPresentationAttributeStyle();
+ setNeedsStyleRecalc(LocalStyleChange,
+ StyleChangeReasonForTracing::fromAttribute(attrName));
+ }
+
bool isLengthAttribute = attrName == SVGNames::cxAttr
- || attrName == SVGNames::cyAttr
- || attrName == SVGNames::rxAttr
- || attrName == SVGNames::ryAttr;
+ || attrName == SVGNames::cyAttr
+ || isPresentationLengthAttribute;
if (isLengthAttribute)
updateRelativeLengthsInformation();
« no previous file with comments | « Source/core/svg/SVGEllipseElement.h ('k') | Source/core/svg/SVGRectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698