W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2014

Re: Exception usage

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Wed, 12 Feb 2014 03:20:46 +0200
Message-ID: <52FACC6E.3090309@helsinki.fi>
To: Anne van Kesteren <annevk@annevk.nl>, Matt Brubeck <mbrubeck@mozilla.com>
CC: "public-pointer-events@w3.org" <public-pointer-events@w3.org>
On 02/11/2014 07:11 PM, Anne van Kesteren wrote:
> On Tue, Feb 11, 2014 at 4:54 PM, Matt Brubeck <mbrubeck@mozilla.com> wrote:
>> On 2/3/2014 6:05 AM, Anne van Kesteren wrote:
>>> Over in DOM/IDL land we are still unsure around DOMException and
>>> especially new names for it.
>>
>> Could you give us a pointer to the latest documentation or discussion on
>> this?  Is there any consensus emerging around an alternative?
>
> There's http://esdiscuss.org/topic/error-objects-in-w3c-apis and
> there's a couple of bugs filed on IDL to import everything from DOM
> regarding errors.
>
>
>>> Given that the semantics of your exception perfectly match JavaScript's
>>> built-in RangeError exception I strongly recommend using that over minting
>>> something new.
>>
>> We're open to changing this, though we might want to double-check that there
>> isn't too much existing content depending on the shipping implementation in
>> IE11.  (We expect there is not.)
>>
>> However, we're not sure that RangeError is really a perfect match. Active
>> pointerIds do not necessarily form a contiguous range.  For example, 5 and 7
>> might be valid arguments to setPointerCapture, while 6 is invalid.  It seems
>> surprising for setPointerCapture(6) to throw a RangeError in that case.  Is
>> there any other existing DOM or ECMAScript error that is a better fit?
>
> RangeError would still be correct in that case I think. See
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize
> for precedent.
>
>


http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.normalize is still quite different.
There you have a predefined set of values, and if something else is passed, it is RangeError.

pointerId can be any random number. RangeError gives a wrong hint that there would be some sort of
continuous range, and that is explicitly what we don't want.
Received on Wednesday, 12 February 2014 01:21:23 UTC

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