Re: [dom] Consider new method: getNodesByType (#37)

1. What's your use-case for getting comments from the DOM more easily?

2. Your example use-case for attributes (getting an attribute of a given name regardless of what element it lives on) is easily doable with existing APIs, such as `document.querySelector("[my-attr]").getAttribute("my-attr")`.  It's a bit of repetition, but this is also a pretty rare case, so that's usually okay.

    As well, the fact that attributes are nodes is a legacy mistake that we want to forget as much as possible.  We already tried to kill the whole thing (and had to back it out due to site breakage), but probably don't want to add *new* things that treat attributes as nodes.

3. If you want all the text in an element, the best way is to use `el.textContent`.  Do you have any use-case for getting all the actual text nodes themselves?

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

Received on Thursday, 28 May 2015 00:47:03 UTC