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

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

Issue 980233002: [svg2] Make 'cx', 'cy' and 'r' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 9 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/SVGCircleElement.cpp ('k') | no next file » | 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 cc470d28db4b9fb1935f805fc62cc1c538c32625..3a30df72eddf838f64724475a66931c7a325cda6 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -69,14 +69,16 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
bool SVGEllipseElement::isPresentationAttribute(const QualifiedName& attrName) const
{
- if (attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
+ if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
+ || 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)
+ if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr
+ || attrName == SVGNames::rxAttr || attrName == SVGNames::ryAttr)
return true;
return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName);
}
@@ -84,7 +86,11 @@ bool SVGEllipseElement::isPresentationAttributeWithSVGDOM(const QualifiedName& a
void SVGEllipseElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
RefPtrWillBeRawPtr<SVGAnimatedPropertyBase> property = propertyFromAttribute(name);
- if (property == m_rx)
+ if (property == m_cx)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyCx, *m_cx->currentValue());
+ else if (property == m_cy)
+ addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyCy, *m_cy->currentValue());
+ else if (property == m_rx)
addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRx, *m_rx->currentValue());
else if (property == m_ry)
addSVGLengthPropertyToPresentationAttributeStyle(style, CSSPropertyRy, *m_ry->currentValue());
@@ -102,33 +108,17 @@ 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
- || isPresentationLengthAttribute;
-
- if (isLengthAttribute)
- updateRelativeLengthsInformation();
+ 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 SVGEllipseElement::selfHasRelativeLengths() const
« no previous file with comments | « Source/core/svg/SVGCircleElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698