W3C home > Mailing lists > Public > www-svg@w3.org > February 2012

Re: <number-optional-number> and integer pairs

From: Erik Dahlstrom <ed@opera.com>
Date: Mon, 13 Feb 2012 12:51:17 +0100
To: www-svg@w3.org
Message-ID: <op.v9l8jry2geuyw5@localhost.localdomain>
On Sun, 12 Feb 2012 08:30:45 +0100, Cameron McCormack <cam@mcc.id.au>  
wrote:

> Dirk Schulze:
>> But just for 'filterRes' it is specified what to do if the number is not
>> an integer [2]:
>>
>> "Non-integer values are truncated, i.e rounded to the closest integer
>> value towards zero."
>>
>> It is not specified what to do for the 'order' attribute.
>> Right now WebKit rounds the values of 'filterRes' and 'order' to
>> integers after parsing them as <number>. Opera rounds at least
>> 'filterRes' (did not check 'order') and according to Robert Longson
>> FireFox just excepts integers.
>>
>> I think it is kind of bad to let <number-optional-number> represent
>> number pairs _and_ integer pairs. I'd suggest to either add a new SVG
>> data type <integer-optional-integer> or don't use pairs but single
>> attributes: 'orderX', 'orderY', 'filterResX', 'filterResY'.
>
> I agree, there is an inconsistency here.  I would be in favour of either  
> defining the rounding behaviour for order to be the same as for  
> filterRes, or for the definition to change to be a new  
> <integer-optional-integer>.  I would prefer the former since it makes it  
> consistent with filterRes, plus it would be more tolerant to rounding  
> errors if filterRes is being set from script due to some calculation.
>
> I have raised https://www.w3.org/Graphics/SVG/WG/track/issues/2438 for  
> this.

I agree that it's better to be tolerant about fractions in the 'order'  
attribute.

One alternative interpretation, which is probably less desirable, is to  
use the lacuna value '3' when the specified value is "in error" or  
otherwise invalid. The spec does say at the moment that the values must be  
integers, on the other hand it also says that the attribute value is  
number-optional-number.

The spec currently says that non-integer values for the attributes  
'filterRes' and 'seed' should be truncated, so I'd suggest aligning  
'order' with that.


-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed
Received on Monday, 13 February 2012 11:51:49 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:50 GMT