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

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.

Received on Sunday, 12 February 2012 07:31:15 UTC