[webkit-dev] AncestorChainWalker substance and style thoughts
darin at apple.com
Mon Feb 18 18:21:54 PST 2013
On Feb 18, 2013, at 6:18 PM, Hajime Morrita <morrita at chromium.org> wrote:
> Non-trivial tree traversal API in general should, IMO, be modeled after recently introduced NodeTraversal. Having separate namespaces allows us to keep Node API minimal. Also it is stateless and simple. I made NodeRenderingTraversal in that way. AncestorChainWalker could be just merged to NodeRenderingTraversal.
That sounds like a promising direction.
> Speaking of ComposedShadowTreeWalker, I think it is worth having a class instead of namespace
> since it holds configuration parameters to decide, for example, whether it skips specific types of node.
I think this depends on how often this is used, and how.
The designers of the DOM took an approach like this with NodeIterator and it has not proved a popular API design with clients.
More information about the webkit-dev