[dom] Consider adding more utils to Elements (#145)

One thing people seem to especially dislike about "vanilla dom" is that they are forced to loop over collection of elements to perform simple operations; for instance, adding a simple `class=""` to all elements selected

Sure having Elements extending Array simplifies this now, as you can use `forEach`, `map`, `reduce`, etc, but I believe for some cases the code to use would be too verbose to write by hand every time (especially if compared to the equivalent in jQuery)

I'm very aware that the risk here is introducing new functionality that is redundant to something that is already possible using existing DOM or ES, but at the same time I think that a very limited set of functionalities/shortcuts would be very handy to have

Though, I don't have anything particular in mind yet, apart `classList` and `dataList` Do you guys have any idea?

```
AggregateTokenList
{
    boolean allContain(token);
    boolean someContain(token);
    void add();
    void remove();
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/145

Received on Thursday, 7 January 2016 07:25:44 UTC