Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-24 Thread Ian Hickson
On Fri, 30 Jul 2010, Jonas Sicking wrote: Before changing something this substantial, I'd like to have implementor feedback regarding what the best way to address this is [...] Given how often this comes up, I think it's worth addressing this. Based on the discussions, it really doesn't

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-05 Thread Oliver Hunt
On Aug 4, 2010, at 6:26 PM, Garrett Smith wrote: On 8/4/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote: On 8/4/10, Garrett Smith dhtmlkitc...@gmail.com wrote: [...] submitButton in form.elements Existing implementations vary on when they use

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-05 Thread Garrett Smith
On 8/5/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 6:26 PM, Garrett Smith wrote: On 8/4/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote: On 8/4/10, Garrett Smith dhtmlkitc...@gmail.com wrote: [...] submitButton in form.elements

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-05 Thread Garrett Smith
On 8/5/10, Garrett Smith dhtmlkitc...@gmail.com wrote: On 8/5/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 6:26 PM, Garrett Smith wrote: On 8/4/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote: On 8/4/10, Garrett Smith

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Alex Russell
Sorry for the lagged response, On Fri, Jul 30, 2010 at 2:56 PM, Oliver Hunt oli...@apple.com wrote: On Jul 30, 2010, at 2:46 PM, Alex Russell wrote: On Fri, Jul 30, 2010 at 4:18 AM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jul 29, 2010 at 5:45 PM, Ian Hickson i...@hixie.ch wrote: The

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Jonas Sicking
On Wed, Aug 4, 2010 at 11:10 AM, Alex Russell slightly...@google.com wrote: Sorry for the lagged response, On Fri, Jul 30, 2010 at 2:56 PM, Oliver Hunt oli...@apple.com wrote: On Jul 30, 2010, at 2:46 PM, Alex Russell wrote: On Fri, Jul 30, 2010 at 4:18 AM, Jonas Sicking jo...@sicking.cc

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Maciej Stachowiak
On Aug 4, 2010, at 2:40 PM, Jonas Sicking wrote: On Wed, Aug 4, 2010 at 11:10 AM, Alex Russell slightly...@google.com wrote: Sorry for the lagged response, On Fri, Jul 30, 2010 at 2:56 PM, Oliver Hunt oli...@apple.com wrote: On Jul 30, 2010, at 2:46 PM, Alex Russell wrote:

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Garrett Smith
On 8/4/10, Jonas Sicking jo...@sicking.cc wrote: On Wed, Aug 4, 2010 at 11:10 AM, Alex Russell slightly...@google.com wrote: Sorry for the lagged response, On Fri, Jul 30, 2010 at 2:56 PM, Oliver Hunt oli...@apple.com wrote: On Jul 30, 2010, at 2:46 PM, Alex Russell wrote: On Fri, Jul 30,

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Garrett Smith
On 8/4/10, Garrett Smith dhtmlkitc...@gmail.com wrote: [...] submitButton in form.elements Existing implementations vary on when they use catchalls. I'd like to see standardization for this behavior and codification so that implementations behave similarly -- either use a catchall for a

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Oliver Hunt
On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote: On 8/4/10, Garrett Smith dhtmlkitc...@gmail.com wrote: [...] submitButton in form.elements Existing implementations vary on when they use catchalls. I'd like to see standardization for this behavior and codification so that

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-04 Thread Garrett Smith
On 8/4/10, Oliver Hunt oli...@apple.com wrote: On Aug 4, 2010, at 3:32 PM, Garrett Smith wrote: On 8/4/10, Garrett Smith dhtmlkitc...@gmail.com wrote: [...] submitButton in form.elements Existing implementations vary on when they use catchalls. I'd like to see standardization for this

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread And Clover
On 07/30/2010 06:43 AM, Oliver Hunt wrote: all array functions defined in ES5 are generic in that they work over any array-like object. They're guaranteed to work over any array-like native JavaScript object. They're *not* guaranteed to work on host objects like the various node lists.

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Oliver Hunt
On Aug 2, 2010, at 7:36 AM, And Clover wrote: On 07/30/2010 06:43 AM, Oliver Hunt wrote: all array functions defined in ES5 are generic in that they work over any array-like object. They're guaranteed to work over any array-like native JavaScript object. They're *not* guaranteed to work

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Garrett Smith
On 8/2/10, Oliver Hunt oli...@apple.com wrote: On Aug 2, 2010, at 7:36 AM, And Clover wrote: On 07/30/2010 06:43 AM, Oliver Hunt wrote: all array functions defined in ES5 are generic in that they work over any array-like object. They're guaranteed to work over any array-like native

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Oliver Hunt
On Aug 2, 2010, at 12:57 PM, Garrett Smith wrote: I also linked to the old catchalls proposal earlier in the thread. That is because the host objects mentioned here have a specialized catchall behavior that isn't yet defined by any specification, so when the code has property access with an

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Jonas Sicking
On Fri, Jul 30, 2010 at 2:46 PM, Alex Russell slightly...@google.com wrote: On Fri, Jul 30, 2010 at 4:18 AM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jul 29, 2010 at 5:45 PM, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri,

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread And Clover
On 08/02/2010 09:57 PM, Garrett Smith wrote: Can it be argued as to what integer index means? And what is a string index? Good catch, that's pretty ambiguous language. Browsers implement this as if integer index were equal to the term array index defined section 15.4 of ECMA262 (that is an

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Garrett Smith
On 8/2/10, And Clover and...@doxdesk.com wrote: On 08/02/2010 09:57 PM, Garrett Smith wrote: Can it be argued as to what integer index means? And what is a string index? Good catch, that's pretty ambiguous language. Browsers implement this as if integer index were equal to the term array

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-08-02 Thread Garrett Smith
On 8/2/10, Garrett Smith dhtmlkitc...@gmail.com wrote: On 8/2/10, And Clover and...@doxdesk.com wrote: On 08/02/2010 09:57 PM, Garrett Smith wrote: [...] ({}).hasOwnProperty.call(document.links, 0); - and resulting true in IE. However, that hasOwnProperty check does not always true for

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-30 Thread Jonas Sicking
On Thu, Jul 29, 2010 at 5:45 PM, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David Bruant wrote: Make that HTMLCollection (and all HTML*Collection, as a consequence of inheritence of HTMLCollection) inherit

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-30 Thread Mike Shaver
On Fri, Jul 30, 2010 at 12:43 AM, Oliver Hunt oli...@apple.com wrote: The various html collections aren't fixed length, they're not assignable, so they can't used interchangeably with arrays at the best of times. Array generics work on arrays that aren't fixed-length, perhaps obviously, and I

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-30 Thread Garrett Smith
On 7/29/10, Garrett Smith dhtmlkitc...@gmail.com wrote: On 7/29/10, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David Bruant wrote: [...] The difficulty is getting the special behavior for [[Get]] which would

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-30 Thread Alex Russell
On Fri, Jul 30, 2010 at 4:18 AM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jul 29, 2010 at 5:45 PM, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David Bruant wrote: Make that HTMLCollection (and all

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-30 Thread Oliver Hunt
On Jul 30, 2010, at 2:46 PM, Alex Russell wrote: On Fri, Jul 30, 2010 at 4:18 AM, Jonas Sicking jo...@sicking.cc wrote: On Thu, Jul 29, 2010 at 5:45 PM, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-29 Thread Ian Hickson
The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David Bruant wrote: Make that HTMLCollection (and all HTML*Collection, as a consequence of inheritence of HTMLCollection) inherit from the ECMAScript Array prototype. This way, it will make

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-29 Thread Alex Russell
On Mon, Apr 26, 2010 at 10:04 AM, David Flanagan da...@davidflanagan.com wrote: Erik Arvidsson wrote: for (var i = 0, length = collection.length; i length; i++) // instead of: for (var i = 0; i collection.length; i++) Actually, the former is a problem when the nodelist is modified in the

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-29 Thread Oliver Hunt
On Jul 29, 2010, at 9:03 PM, Alex Russell wrote: On Mon, Apr 26, 2010 at 10:04 AM, David Flanagan da...@davidflanagan.com wrote: Erik Arvidsson wrote: for (var i = 0, length = collection.length; i length; i++) // instead of: for (var i = 0; i collection.length; i++) Actually, the

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-07-29 Thread Garrett Smith
On 7/29/10, Ian Hickson i...@hixie.ch wrote: The e-mails quoted below consist of the salient points of this thread: On Fri, 23 Apr 2010, David Bruant wrote: [...] Or we can just leave the DOM as it is and get used to calling the equivalent of Prototype's $A() function. Before changing

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-29 Thread Geoffrey Sneddon
On 28/04/10 23:28, Garrett Smith wrote: On Wed, Apr 28, 2010 at 2:12 AM, James Grahamjgra...@opera.com wrote: On 04/28/2010 10:27 AM, David Bruant wrote: When I started this thread, my point was to define a normalized way (through ECMAScript binding) to add array extras to array-like objects

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-29 Thread Garrett Smith
On Thu, Apr 29, 2010 at 6:59 AM, Geoffrey Sneddon gsned...@opera.com wrote: On 28/04/10 23:28, Garrett Smith wrote: On Wed, Apr 28, 2010 at 2:12 AM, James Grahamjgra...@opera.com  wrote: On 04/28/2010 10:27 AM, David Bruant wrote: When I started this thread, my point was to define a

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-28 Thread Garrett Smith
On Mon, Apr 26, 2010 at 10:04 AM, David Flanagan da...@davidflanagan.com wrote: Erik Arvidsson wrote: [snip] Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method?  This makes it clear that a collection is not an array, but clearly

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-28 Thread David Bruant
Le 28/04/2010 00:03, Garrett Smith a écrit : On Mon, Apr 26, 2010 at 10:04 AM, David Flanagan da...@davidflanagan.com wrote: Erik Arvidsson wrote: [snip] Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray()

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-28 Thread Geoffrey Sneddon
On 27/04/10 20:23, David Bruant wrote: Le 27/04/2010 03:54, Geoffrey Sneddon a écrit : On 26/04/10 19:50, And Clover wrote: David Flanagan wrote: Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method? I like that, as a practical and

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-28 Thread James Graham
On 04/28/2010 10:27 AM, David Bruant wrote: When I started this thread, my point was to define a normalized way (through ECMAScript binding) to add array extras to array-like objects in the scope of HTML5 (HTMLCollection and inheriting interfaces). I don't see any reason yet to try to find a

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (ATTN IE TEAM - TRAVIS LEITHEAD)

2010-04-28 Thread Garrett Smith
On Wed, Apr 28, 2010 at 2:12 AM, James Graham jgra...@opera.com wrote: On 04/28/2010 10:27 AM, David Bruant wrote: When I started this thread, my point was to define a normalized way (through ECMAScript binding) to add array extras to array-like objects in the scope of HTML5 (HTMLCollection

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (JZ and David Bruant)

2010-04-27 Thread David Bruant
Le 26/04/2010 11:25, Frank Migacz a écrit : What is the implication of denying dynamic changes to the HTMLCollection in a CORS environment? In some variant of Comet (or asynchronous UA polling), how can the UA implement change if it is regularly processing inside locked control blocks? I am

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-27 Thread Geoffrey Sneddon
On 26/04/10 19:50, And Clover wrote: David Flanagan wrote: Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method? I like that, as a practical and explicit (JavaScript-specific) binding. In the longer term, what's the thinking on a more

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-27 Thread David Bruant
Le 27/04/2010 03:54, Geoffrey Sneddon a écrit : On 26/04/10 19:50, And Clover wrote: David Flanagan wrote: Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method? I like that, as a practical and explicit (JavaScript-specific) binding. In

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-26 Thread David Flanagan
Erik Arvidsson wrote: for (var i = 0, length = collection.length; i length; i++) // instead of: for (var i = 0; i collection.length; i++) Actually, the former is a problem when the nodelist is modified in the loop; it may result in collection[i] being undefined. Even when checking the

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-26 Thread Garrett Smith
On Mon, Apr 26, 2010 at 9:49 AM, Erik Arvidsson a...@chromium.org wrote: On Sun, Apr 25, 2010 at 01:07, David Bruant bru...@enseirb-matmeca.fr wrote: Le 25/04/2010 00:39, J Z a écrit : I have thought a lot about weirdnesses that people could think about like trying to assign a value to the

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-26 Thread Erik Arvidsson
Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method?  This makes it clear that a collection is not an array, but clearly defines a way to obtain an array.  Clever implementors might even be able to optimize common uses-cases using some

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-26 Thread And Clover
David Flanagan wrote: Rather that trying to make DOM collections feel like arrays, how about just giving them a toArray() method? I like that, as a practical and explicit (JavaScript-specific) binding. In the longer term, what's the thinking on a more basic change: - Require specific DOM

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection (JZ and David Bruant)

2010-04-26 Thread Frank Migacz
What is the implication of denying dynamic changes to the HTMLCollection in a CORS environment? In some variant of Comet (or asynchronous UA polling), how can the UA implement change if it is regularly processing inside locked control blocks? Please pardon my ignorance of the details.

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-26 Thread David Bruant
Le 26/04/2010 10:33, Garrett Smith a écrit : On Mon, Apr 26, 2010 at 9:49 AM, Erik Arvidssona...@chromium.org wrote: On Sun, Apr 25, 2010 at 01:07, David Bruantbru...@enseirb-matmeca.fr wrote: Le 25/04/2010 00:39, J Z a écrit : I have thought a lot about weirdnesses that

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-25 Thread Garrett Smith
On Sat, Apr 24, 2010 at 10:50 PM, J Z kangax@gmail.com wrote: On Fri, Apr 23, 2010 at 10:30 PM, David Bruant bru...@enseirb-matmeca.fr wrote: Hi, In the HTML5 status of this document section, one can read : This specification is intended to replace (be the new version of) what was

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-25 Thread David Bruant
// turning live collection into static array fixes this Array.slice(document.getElementsByTagName('div')).forEach(function(el) { el.parentNode.removeChild(el); }); Where supported, though top level generics such as Array.slice are not standard, so: var divList =

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-25 Thread J Z
On Sun, Apr 25, 2010 at 2:33 AM, David Bruant bru...@enseirb-matmeca.frwrote: Le 24/04/2010 22:50, J Z a écrit : On Fri, Apr 23, 2010 at 10:30 PM, David Bruant bru...@enseirb-matmeca.frwrote: Hi, In the HTML5 status of this document section, one can read : This specification is

Re: [whatwg] Adding ECMAScript 5 array extras to HTMLCollection

2010-04-25 Thread David Bruant
Le 25/04/2010 00:39, J Z a écrit : I have thought a lot about weirdnesses that people could think about like trying to assign a value to the HTMLCollection (divs[14] = myOtherDiv), but once again, it wouldn't be more allowed than it currently is (I have no idea of what happens