W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: comments on Matrix

From: Dirk Schulze <dschulze@adobe.com>
Date: Thu, 21 Mar 2013 11:47:44 -0700
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Rik Cabanier <cabanier@gmail.com>, Benoit Jacob <jacob.benoit.1@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <7184E7B0-7279-46A7-AC37-5B3DF59DDFB3@adobe.com>


Sent from my iPhone

On Mar 21, 2013, at 11:27 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Thu, Mar 21, 2013 at 11:21 AM, Rik Cabanier <cabanier@gmail.com> wrote:
>> Direct2D also refuses to do the inversion:
>> http://msdn.microsoft.com/en-us/library/windows/desktop/dd372277(v=vs.85).aspx
>> Given that all the libraries refuse to invert and all of Adobe's graphics
>> applications (such as Photoshop and Illustrator) do the same under the hood
>> with no ill effects, let's not do this by default.
>> 
>> If you feel very strongly, we can provide another call that never throws. We
>> would have to change the IDL of the matrix interface though since it could
>> now contain unrestricted doubles.
> 
> This is very much the wrong decision.  Throwing is a *very* disruptive
> thing in Javascript.  You don't just "catch it and abort", because
> there's rarely a reason to assume that any given calculation will
> fail.  Do you wrap try/catches around every single matrix inversion in
> your code?  Of course not.
> 
> Web APIs should *not* be throwing except in actual exceptional error
> situations.  When possible, they should fail gracefully.  Anything
> else is just asking for pages to die for no good reason.  The fact
> that this can throw or not depending on the precise algorithm/number
> implementation underneath makes it even worse.
> 
> If you'd like to track whether or not the inversion failed, so authors
> don't have to check the matrix themselves, add a flag.
> 
> I'll formally object to an exception being thrown here.

Why didn't you object to SVG 1.1 :). 

To be honest, SVGMatrix is the only reason why I added this exception to the Matrix Interface in the first place. Even so, what do you return when you do not throw? A matrix with a bunch of NaN as suggested by Benoit? Even if all attributes are restricted doubles?

Greetings
Dirk

> 
> ~TJ
> 
Received on Thursday, 21 March 2013 18:49:14 GMT

This archive was generated by hypermail 2.3.1 : Thursday, 21 March 2013 18:49:15 GMT