Report an issue
Class

CKEDITOR.dom.walker

class

Utility class to "walk" the DOM inside range boundaries. If the range starts or ends in the middle of the text node, this node will be included as a whole. Outside changes to the range may break the walker.

The walker may return nodes that are not totally included in the range boundaries. Let us take the following range representation, where the square brackets indicate the boundaries:

[<p>Some <b>sample] text</b>

While walking forward into the above range, the following nodes are returned: <p>, "Some ", <b> and "sample". Going backwards instead we have: "sample" and "Some ". So note that the walker always returns nodes when "entering" them, but not when "leaving" them. The guard function is instead called both when entering and when leaving nodes.

Filtering

Properties

  • evaluator : Function

    A function executed for every matched node to check whether it is to be considered in the walk or not. If not provided, all matched nodes are considered good.

    If the function returns false, the node is ignored.

  • guard : Function

    A function executed for every node the walk passes by to check whether the walk is to be finished. It is called both when entering and when exiting nodes, as well as for the matched nodes.

    If this function returns false, the walking ends and no more nodes are evaluated.

  • private

    _ : Object

    Defaults to {}

Static properties

Methods