TreeWalkerValue (engine/model)
@ckeditor/ckeditor5-engine/src/model/treewalker
typedef
Object
Object returned by TreeWalker
when traversing tree model.
Filtering
Properties
-
Item between old and new positions of
TreeWalker
. -
length : Number
Length of the item. For
'elementStart'
and'character'
it is 1. For'text'
it is the length of the text. For'elementEnd'
it is undefined. -
Next position of the iterator.
- Forward iteration: For
'elementStart'
it is the first position inside the element. For all other types it is the position after the item. - Backward iteration: For
'elementEnd'
it is last position inside element. For all other types it is the position before the item.
- Forward iteration: For
-
Previous position of the iterator.
- Forward iteration: For
'elementEnd'
it is the last position inside the element. For all other types it is the position before the item. Note that it is more efficient to use this position then calculate the position before the node usingcreateBefore
. It is also more efficient to get the position after node by shiftingpreviousPosition
bylength
, usinggetShiftedBy
, then calculate the position usingcreateAfter
. - Backward iteration: For
'elementStart'
it is the first position inside the element. For all other types it is the position after item.
- Forward iteration: For
-