Implemented according to https://dom.spec.whatwg.org/#treewalker

TreeWalker on MDN

Constructors

  • Creates a new TreeWalker instance.

    Parameters

    • root: Node

      A root Node of this TreeWalker traversal.

    • OptionalwhatToShow: number

      A unsigned long representing a bitmask created by combining the constant properties of NodeFilter.

    • filter: null | NodeFilter = null

      A NodeFilter, that is an object with a method acceptNode, which is called by the TreeWalker to determine whether to accept a node that has passed the whatToShow check.

    Returns TreeWalker

Properties

currentNode: Node
filter: null | NodeFilter
root: Node

TreeWalker.root on MDN

whatToShow: number

Methods