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

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

Issue 307643003: Don't render empty shapes with non-scaling-stroke (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update TEs. Created 6 years, 7 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/RenderSVGEllipse.cpp
diff --git a/Source/core/rendering/svg/RenderSVGEllipse.cpp b/Source/core/rendering/svg/RenderSVGEllipse.cpp
index bc3cfaea44be297b3752b1b772ab79e5cb10d9ea..5f77644c72b266b5614265c0299ef52dd9c6a94f 100644
--- a/Source/core/rendering/svg/RenderSVGEllipse.cpp
+++ b/Source/core/rendering/svg/RenderSVGEllipse.cpp
@@ -53,20 +53,22 @@ void RenderSVGEllipse::updateShapeFromElement()
m_center = FloatPoint();
m_radii = FloatSize();
- // Fallback to RenderSVGShape if shape has a non-scaling stroke.
- if (hasNonScalingStroke()) {
- RenderSVGShape::updateShapeFromElement();
- m_usePathFallback = true;
- return;
- } else
- m_usePathFallback = false;
-
calculateRadiiAndCenter();
// Spec: "A negative value is an error. A value of zero disables rendering of the element."
- if (m_radii.isZero() || m_radii.width() < 0 || m_radii.height() < 0)
+ if (m_radii.width() < 0 || m_radii.height() < 0)
return;
+ if (!m_radii.isEmpty()) {
+ // Fallback to RenderSVGShape if shape has a non-scaling stroke.
+ if (hasNonScalingStroke()) {
+ RenderSVGShape::updateShapeFromElement();
+ m_usePathFallback = true;
+ return;
+ }
+ m_usePathFallback = false;
+ }
+
m_fillBoundingBox = FloatRect(m_center.x() - m_radii.width(), m_center.y() - m_radii.height(), 2 * m_radii.width(), 2 * m_radii.height());
m_strokeBoundingBox = m_fillBoundingBox;
if (style()->svgStyle()->hasStroke())
« no previous file with comments | « LayoutTests/svg/custom/non-scaling-stroke-on-empty-shapes-expected.html ('k') | Source/core/rendering/svg/RenderSVGRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698