Re: Elements array and query/queryAll methods

The question I have about this proposal is how do we handle people
adding non-elements to the array?

    var elems = document.queryAll("p");
    elems.push(null);
    elems.queryAll("span");

Does the push throw an error? Or the subsequent queryAll call? Or is
the null value simply ignored?

Also, this is much harder to polyfill than the previous find(All)
proposal.The polyfill you linked to requires ES6 and I'm not convinced
it works anyway, won't it potentially allow duplicates in the
resulting Array?

-dean

On 8 April 2014 18:07, Anne van Kesteren <annevk@annevk.nl> wrote:
> Can we use www-dom@w3.org for the DOM? Also, please use
> http://dom.spec.whatwg.org/ as that's the canonical version.
>
>> From: Eric Devine
>>
>> What use cases is Elements intended to solve the NodeList and HTMLCollection
>> aren't suited for?
>
> It's meant to be a better API. E.g. have map and such.
>
>
>> What other functions return an Elements object?
>
> Just these for now.
>
>
>> Will there be a "live" Elements array?
>
> We should not introduce more live lists. They are bad.
>
>
>> Is Elements intended to replace the use of NodeList and HTMLCollection?
>
> Yes.
>
>
>> Where can I find the UA implementation status for these features?
>
> No implementation yet.
>
>
>> Does anyone know of a polyfill for either?
>
> https://gist.github.com/domenic/5864658 is an illustration of how this
> could be implemented going forward.
>
>
> --
> http://annevankesteren.nl/
>

Received on Tuesday, 8 April 2014 17:40:19 UTC