W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

[Bug 28875] [EnforceRange] accepts an odd set of input values

From: <bugzilla@jessica.w3.org>
Date: Wed, 01 Jul 2015 21:08:59 +0000
To: public-script-coord@w3.org
Message-ID: <bug-28875-3890-7PVRdg0qbJ@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28875

Jeffrey Yasskin <jyasskin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sleevi@google.com

--- Comment #2 from Jeffrey Yasskin <jyasskin@gmail.com> ---
Thanks for finding the extra uses.

We're excluding some non-integral arguments, but not a consistent set. (That's
similar to a lot of Javascript, so maybe it's ok; I'm just checking that it's
intentional.)

If we want to exclude "strange" input values without breaking "123", I think
the appropriate algorithm is something like:

1. Initialize p to ToPrimitive(V, hint Number).
2. If p is "" or null, throw a TypeError.  // Excludes empty arrays.
3. Initialize x to ToNumber(p).
4. If x is NaN, +∞, or −∞, then throw a TypeError.
5. Set x to sign(x) * floor(abs(x)).
6. If x < 0 or x > 2^32 − 1, then throw a TypeError.
7. Return the IDL unsigned long value that represents the same numeric value as
x.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 1 July 2015 21:09:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 1 July 2015 21:09:07 UTC