| Index: Source/core/rendering/svg/RenderSVGRect.cpp
|
| diff --git a/Source/core/rendering/svg/RenderSVGRect.cpp b/Source/core/rendering/svg/RenderSVGRect.cpp
|
| index efda77379dbd5ab36a5b81ff9cbf6669f6c096ec..e49e0a12d553b94bc03238f2a24dd5c5ab624198 100644
|
| --- a/Source/core/rendering/svg/RenderSVGRect.cpp
|
| +++ b/Source/core/rendering/svg/RenderSVGRect.cpp
|
| @@ -54,20 +54,23 @@ void RenderSVGRect::updateShapeFromElement()
|
| ASSERT(rect);
|
|
|
| SVGLengthContext lengthContext(rect);
|
| - // Fallback to RenderSVGShape if rect has rounded corners or a non-scaling stroke.
|
| - if (rect->rx()->currentValue()->value(lengthContext) > 0 || rect->ry()->currentValue()->value(lengthContext) > 0 || hasNonScalingStroke()) {
|
| - RenderSVGShape::updateShapeFromElement();
|
| - m_usePathFallback = true;
|
| - return;
|
| - }
|
| -
|
| - m_usePathFallback = false;
|
| FloatSize boundingBoxSize(rect->width()->currentValue()->value(lengthContext), rect->height()->currentValue()->value(lengthContext));
|
|
|
| - // Spec: "A negative value is an error. A value of zero disables rendering of the element."
|
| - if (boundingBoxSize.isZero() || boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0)
|
| + // Spec: "A negative value is an error."
|
| + if (boundingBoxSize.width() < 0 || boundingBoxSize.height() < 0)
|
| return;
|
|
|
| + // Spec: "A value of zero disables rendering of the element."
|
| + if (boundingBoxSize.width() > 0 && boundingBoxSize.height() > 0) {
|
| + // Fallback to RenderSVGShape if rect has rounded corners or a non-scaling stroke.
|
| + if (rect->rx()->currentValue()->value(lengthContext) > 0 || rect->ry()->currentValue()->value(lengthContext) > 0 || hasNonScalingStroke()) {
|
| + RenderSVGShape::updateShapeFromElement();
|
| + m_usePathFallback = true;
|
| + return;
|
| + }
|
| + m_usePathFallback = false;
|
| + }
|
| +
|
| m_fillBoundingBox = FloatRect(FloatPoint(rect->x()->currentValue()->value(lengthContext), rect->y()->currentValue()->value(lengthContext)), boundingBoxSize);
|
|
|
| // To decide if the stroke contains a point we create two rects which represent the inner and
|
|
|