SVGMatrix on not supported transform function (was Re: review comments for SVG-related parts of css3-transforms)

On Mar 13, 2012, at 11:01 PM, Dirk Schulze wrote:

>> 
>> 
>> 
>>   It might still be possible to get the ‘SVGMatrix’ by the attribute
>>   ‘matrix’.
>> 
>> We should define exactly in which circumstances it is not possible to,
>> and what the attribute should return in those cases.
> You are right. We can differ between two types
> 
> 1) Not supported 2D transformation functions (translateX, translateY, scaleX, scaleY)
>   We could easily return a SVGMatrix here. Returning translate or scale as function type would not be correct in my eyes, since it could conflict with the CSSOM objects that will (hopefully) added to CSS4 Transforms (http://www.w3.org/TR/css3-3d-transforms/#csstransformvalue-interface link will not be reachable soon). For these transformation functions we should return UNKNOWN as type.
> 2) 3D Transformation functions
>   Not only that we don't support 3D Transformation functions in SVG DOM, they might also not be transformable to 3x2 matrices. But there are still excuses like rotateZ, translate3d where the third argument is zero and so on. The easiest way would be not to support them at all. Otherwise it needs to get specified what to do for every function.
> 
> One problem after reading the SVG spec again: SVG does not specify how SVGMatrix should look like for UNKNOWN transformation functions, correct? Should all values be zero? Should it be the identity matrix?
> 
> I'd like to let this part unspecified and recommend that future versions of the SVG spec should specify it.
I replaced the wording by

""
If a two-dimensional transform function is not supported, the attribute ‘matrix’ must return a 3x2 ‘SVGMatrix’ with the corresponding values as described in the section Mathematical Description of Transformation Functions.
""

Dirk

Received on Friday, 16 March 2012 16:43:29 UTC