Re: Pass criteria for shapes-rect-01-t.svg

On Fri, 24 Oct 2008 09:50:47 +0200, Niklas Hagelroth <niklas.hagelroth@ikivo.com> wrote:

> Hi WG,
>
> One of the subtests in shapes-rect-01-t.svg test rectangles with a specified 'rx' and no 'ry', the 'rx' value is greater than half the width of the rectangle:
>
> <rect xml:id="Simple-round-rect-filled" fill="red" x="350" y="46" width="50" height="80" rx="30" />
>
> During the test fest in Ottawa it was said that this test should result in the effective values rx=25 and ry=25.
>
> However, this is not clear in the specification and most implementations do not do this. Our implementation will result in the values rx=25 and ry=30 which I believe is as correct as rx=25, ry=25.
>
> How you render this depends on how you interpret the spec section below.
>
> Option 1 (in specification order):
>
>             ry=rx;
>             rx= (rx>(width/2)) ? (width/2) : rx;
>             ry= (ry>(height/2)) ? (height/2) : ry;
>             Result: rx=25, ry=30
>
> Option 2:
>
>             rx= (rx>(width/2)) ? (width/2) : rx;
>             ry=rx;
>             ry= (ry>(height/2)) ? (height/2) : ry;
>             Result: rx=25, ry=25
>
> 9.1
>
> [[
>
> If a properly specified value is provided for 'rx' but not for 'ry', then the user agent must process the 'rect' element with the effective value for 'ry' as equal to 'rx'. If a properly specified value is provided for 'ry' but not for 'rx', then the user agent must process the 'rect' element with the effective value for 'rx' as equal to 'ry'. If neither 'rx' nor 'ry' has a properly specified value, then the user agent must process the 'rect' element as if no rounding had been specified, resulting in square corners. If 'rx' is greater than half of the width of the rectangle, then the user agent must process the 'rect' element with the effective value for 'rx' as half of the width of the rectangle. If 'ry' is greater than half of the height of the rectangle, then the user agent must process the 'rect' element with the effective value for 'ry' as half of the height of the rectangle.
>
> ]]
>
> I think that the specification should be updated to state when the clamping and assignment should occur.

This is something that could perhaps be clarified in the SVG 1.1 errata. It is clear that there is some variability between implementations (and even between testsuite reference images, see [1] and [2], even though the test itself seems to be about 8 years old).

In any case the above calculations don't take into account the validity of the rx,ry values.

I do have an ACTION-2249 to write one or more new tests for this, and I just started doing that.

Cheers
/Erik

[1] http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-shapes-rect-01-t.html
[2] http://www.w3.org/Graphics/SVG/Test/20080912/htmlObjectHarness/shapes-rect-01-t.html

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Monday, 1 December 2008 12:14:10 UTC