Re: [whatwg/dom] Suggestion: new method - getNodesByType (#992)

@rniwa That misses the point for the same reason as TreeWalker.  I am proposing a single method that takes a single argument.  There is no internal glue required.  How that method executes internally whether using TreeWalker, nodeIterator, or simply walking the DOM (as in the original demonstration logic) is only a performance factor outside the intention of this proposal.  If either nodeIterator or TreeWalker required no additional logic to get the desired results I wouldn't propose a more simple approach.  Since they do require extensive boilerplate, on each use, XPath as @liamquin pointed out remains a far superior approach.

Consider it from the perspective of querySelectors.  They are likewise just as unnecessary and are thousands of times slower to execute.  From all technical considerations they are a horrible approach when there were already numerous other superior conventions in place to achieve the same output.  Why then were they so highly requested?  They are a single method that requires a single argument.  Unlike querySelectors the proposal here offers no loss of performance and may result in performance improvements at implementation.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/992#issuecomment-866774326

Received on Wednesday, 23 June 2021 11:59:30 UTC