Re: [geometry] DOMMatrix feedback

On Tue, 31 Dec 2013 19:03:23 +0100, Jarek Foksa <jarek@foksa.name> wrote:

> I would like to propose the addition of isIdentity() method to DOMMatrix  
> interface. I often find
> myself checking whether a transformation matrix is an identity matrix in  
> order to avoid
> unnecessary computations.

This would be a convenience API, right?

I think we should wait with adding such things until there is more  
implementation experience and more wide-spread use so that we don't get  
too far ahead of ourselves.

I've filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=24300 to  
remember to revisit this.

> Also, could DOMMatrix constructor accept a dictionary in a similar  
> fashion to DOMPoint? This would
> make it easier to create DOMMatrix from e.g. SVGMatrix or  
> WebKitCSSMatrix instances. Currently
> the spec says that if only one argument is specified then it must be  
> either DOMMatrixReadOnly,
> String or Array. I would add DOM2DMatrixInit and DOM3DMatrixInit to that  
> list:
>
>   dictionary DOM2DMatrixInit {
>     unrestricted double a = 1;
>     unrestricted double b = 0;
>     unrestricted double c = 0;
>     unrestricted double d = 1;
>     unrestricted double e = 0;
>     unrestricted double f = 0;
>   };
>
>   dictionary DOM3DMatrixInit {
>     unrestricted double m11 = 1;
>     unrestricted double m12 = 0;
>     unrestricted double m13 = 0;
>     ...
>   };

Isn't it more convenient to use an array?

Also I think the above wouldn't work since WebIDL wouldn't be able to  
distinguish whether an object is a DOM2DMatrixInit or DOM3DMatrixInit. You  
need to use a single dictionary type, which either means only supporting  
one set of dictionary names or not having default values on the WebIDL  
layer.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 15 January 2014 14:03:19 UTC