engine/model/position
@ckeditor/ckeditor5-engine/src/model/position
Filtering
Classes
-
ModelPosition
module:engine/model/position~ModelPosition
Type Definitions
-
ModelPositionOffset
module:engine/model/position~ModelPositionOffset
-
ModelPositionRelation
module:engine/model/position~ModelPositionRelation
-
ModelPositionStickiness
module:engine/model/position~ModelPositionStickiness
Functions
-
internal
getNodeAfterPosition( position, positionParent, textNode ) → null | ModelNode
module:engine/model/position~getNodeAfterPosition
Returns the node after the given position.
This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the specific position for performance reasons.
Normally, you should use
Position#nodeAfter
. If you start hitting performance issues withPosition#parent
and/orPosition#textNode
check if your algorithm does not access those properties multiple times (which can happen directly or indirectly via other position properties).See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
See also:
Parameters
position : ModelPosition
Position to check.
positionParent : ModelElement | ModelDocumentFragment
The parent of the given position.
textNode : null | ModelText
Text node at the given position.
Returns
null | ModelNode
-
internal
getNodeBeforePosition( position, positionParent, textNode ) → null | ModelNode
module:engine/model/position~getNodeBeforePosition
Returns the node before the given position.
Refer to
getNodeBeforePosition
for documentation on when to use this util method.See also:
Parameters
position : ModelPosition
Position to check.
positionParent : ModelElement | ModelDocumentFragment
The parent of the given position.
textNode : null | ModelText
Text node at the given position.
Returns
null | ModelNode
-
internal
getTextNodeAtPosition( position, positionParent ) → null | ModelText
module:engine/model/position~getTextNodeAtPosition
Returns a text node at the given position.
This is a helper function optimized to reuse the position parent instance for performance reasons.
Normally, you should use
Position#textNode
. If you start hitting performance issues withPosition#parent
check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).See https://github.com/ckeditor/ckeditor5/issues/6579.
See also:
Parameters
position : ModelPosition
positionParent : ModelElement | ModelDocumentFragment
The parent of the given position.
Returns
null | ModelText
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.