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

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 bbox tests. 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..9b57911cd411d18dd24fb274c4d51f11f337684c 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.width() > 0 && m_radii.height() > 0) {
pdr. 2014/05/28 18:21:42 Here and above, isn't this !m_radii.isEmpty()?
fs 2014/05/30 07:43:46 This one should indeed be !isEmpty() - the above o
+ // 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