W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: [DOM4] Use new WebIDL [EnforceRange] attribute?

From: Aryeh Gregor <ayg@aryeh.name>
Date: Tue, 11 Oct 2011 10:14:53 -0400
Message-ID: <CAKA+Axn2YcuBQM+OrCuU24C-5D0voSKoy=JLYDRDxp7rtPEsEA@mail.gmail.com>
To: Cameron McCormack <cam@mozilla.com>
Cc: Robin Berjon <robin@berjon.com>, David Flanagan <dflanagan@mozilla.com>, www-dom@w3.org
On Tue, Oct 11, 2011 at 1:30 AM, Cameron McCormack <cam@mozilla.com> wrote:
> If that is the case, and we want to explicitly allow -1 to mean the end
> of the string, it might be better write that using a signed integer type
> and explicitly handling -1 in that way.

I agree, if we want that behavior.  For the second argument of
deleteData() and replaceData() (length), Gecko does seem to behave
this way, although WebKit throws.  But both Gecko and WebKit throw if
you pass -1 as the *first* argument (offset) of
deleteData()/insertData()/replaceData(), so I don't think changing
behavior there would be good.  We don't want to be inconsistent
either, so at least for deleteData()/insertData()/replaceData(),
always throwing for negative numbers looks like a better idea than not

(I didn't test IE because I didn't want to bother starting my VM.
Opera consistently ignores the function call if provided a negative
number for these three methods, neither wrapping nor throwing.)
Received on Tuesday, 11 October 2011 14:15:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:36:59 UTC