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

Unified Diff: Source/core/rendering/svg/RenderSVGRect.cpp

Issue 16914003: Fix SVG animations which set rx or ry attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update tests with minor nits Created 7 years, 6 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
Index: Source/core/rendering/svg/RenderSVGRect.cpp
diff --git a/Source/core/rendering/svg/RenderSVGRect.cpp b/Source/core/rendering/svg/RenderSVGRect.cpp
index b981366bac0326a4bcfdf5b8ca43ad20d70c11a9..2df1cf6853031bb165b7ab756857d75a872836ea 100644
--- a/Source/core/rendering/svg/RenderSVGRect.cpp
+++ b/Source/core/rendering/svg/RenderSVGRect.cpp
@@ -53,15 +53,15 @@ void RenderSVGRect::updateShapeFromElement()
SVGRectElement* rect = static_cast<SVGRectElement*>(node());
ASSERT(rect);
+ SVGLengthContext lengthContext(rect);
// Fallback to RenderSVGShape if rect has rounded corners or a non-scaling stroke.
- if (rect->hasAttribute(SVGNames::rxAttr) || rect->hasAttribute(SVGNames::ryAttr) || hasNonScalingStroke()) {
+ if (rect->rx().value(lengthContext) > 0 || rect->ry().value(lengthContext) > 0 || hasNonScalingStroke()) {
RenderSVGShape::updateShapeFromElement();
m_usePathFallback = true;
return;
- } else
- m_usePathFallback = false;
+ }
- SVGLengthContext lengthContext(rect);
+ m_usePathFallback = false;
FloatSize boundingBoxSize(rect->width().value(lengthContext), rect->height().value(lengthContext));
if (boundingBoxSize.isEmpty())
return;
« no previous file with comments | « LayoutTests/svg/stroke/animated-non-scaling-rxry-expected.html ('k') | Source/core/rendering/svg/SVGPathData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698