W3C home > Mailing lists > Public > public-css-bugzilla@w3.org > February 2012

[Bug 15964] Behavior on invalid arguments for CSSMatrix underspecified

From: <bugzilla@jessica.w3.org>
Date: Wed, 22 Feb 2012 14:54:45 +0000
To: public-css-bugzilla@w3.org
Message-Id: <E1S0Daf-0000kV-Oc@jessica.w3.org>

--- Comment #1 from Aryeh Gregor <ayg@aryeh.name> 2012-02-22 14:54:44 UTC ---
These are all handled by WebIDL.  E.g., the declaration "CSSMatrix  
multiply(in CSSMatrix secondMatrix);" means that if anything other than a
CSSMatrix is passed to multiply(), an exception will be thrown.  This is the
algorithm implementations must use for executing operations:


It includes the step "Let values be the result of passing entry and arg0..n−1
to the argument resolution algorithm."  That says:

Initialize values0..m−1 to be a list of IDL values, where valuesi is the result
of converting argi to an IDL value of type ti. These conversions must be done
in order from arg0 to argm−1.

CSSMatrix is an interface type, and to convert to an interface type UAs must
follow this algorithm:


. . . which will throw a TypeError.

So more specifically:

(In reply to comment #0)
> For instance what happens with multiply if null gets passed?

Throws a TypeError, per above.

> What happens if one of the attributes get set with NaN?

Then it gets set as NaN.  WebIDL allows any values for float/double that IEEE
754 does, same as ECMAScript.  This is probably not desired, but it's a WebIDL
bug, not a CSS bug.  I filed bug 16075 against WebIDL.

> What happens on translate, scale, rotate on passing NaN? What will be the
> resulting Matrix?
> What happens if multiply gets a CSSMatrix but some of its attributes are NaN?

In theory, you should follow IEEE 754 rules for multiplication here.  This will
probably result in a bunch more matrix entries getting set to NaN or infinite
values.  This isn't wanted, obviously, which is why WebIDL should specify
throwing a TypeError here.

Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 22 February 2012 14:54:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:36:39 UTC