Bug 554091 - negative rx and ry are unsupported rather than errors according to SVG1.2T. r=jwatt

This commit is contained in:
Robert Longson 2010-03-23 12:53:36 +00:00
parent ced01aa917
commit 6725a73d98
3 changed files with 19 additions and 1 deletions

View File

@ -175,9 +175,12 @@ nsSVGRectElement::ConstructPath(gfxContext *aCtx)
/* In a perfect world, this would be handled by the DOM, and
return a DOM exception. */
if (width <= 0 || height <= 0 || ry < 0 || rx < 0)
if (width <= 0 || height <= 0)
return;
rx = NS_MAX(rx, 0.0f);
ry = NS_MAX(ry, 0.0f);
/* optimize the no rounded corners case */
if (rx == 0 && ry == 0) {
aCtx->Rectangle(gfxRect(x, y, width, height));

View File

@ -0,0 +1,14 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg" >
<title>Testcase for rect with unsupported rx and ry</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=554091 -->
<rect x="0" y="0" width="100%" height="100%" fill="red"/>
<rect x="0" y="0" width="50%" height="100%" rx="-1" fill="lime" />
<rect x="50%" y="0" width="50%" height="100%" ry="-1" fill="lime" />
</svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@ -125,6 +125,7 @@ fails == inline-in-xul-basic-01.xul pass.svg
== radialGradient-basic-03.svg radialGradient-basic-03-ref.svg
== rect-01.svg pass.svg
== rect-02.svg pass.svg
== rect-03.svg pass.svg
== rect-with-rx-and-ry-01.svg pass.svg
== rect-with-rx-or-ry-01.svg rect-with-rx-or-ry-01-ref.svg
== rootElement-null-01.svg pass.svg