DocumentFragment (engine/view)
@ckeditor/ckeditor5-engine/src/view/documentfragment
DocumentFragment class.
Filtering
Properties
-
childCount : Number
readonly
Number of child nodes in this document fragment.
-
isEmpty : Boolean
readonly
Is
true
if there are no nodes inside this document fragment,false
otherwise. -
parent : null
readonly
Artificial parent of
DocumentFragment
. Returnsnull
. Added for compatibility reasons. -
root : DocumentFragment
readonly
Artificial root of
DocumentFragment
. Returns itself. Added for compatibility reasons. -
Array of child nodes.
Methods
-
constructor( [ children ] )
protected
-
Symbol.iterator() → Iterable.<Node>
Iterable interface.
-
_appendChild( items ) → Number
-
_insertChild( index, items ) → Number
-
_removeChildren( index, [ howMany ] ) → Array.<Node>
Removes number of child nodes starting at the given index and set the parent of these nodes to
null
.Parameters
index : Number
Number of the first node to remove.
[ howMany ] : Number
Number of nodes to remove.
Defaults to
1
Returns
Array.<Node>
The array of removed nodes.
-
Gets child at the given index.
-
getChildIndex( node ) → Number
Gets index of the given child node. Returns
-1
if child node is not found. -
getChildren() → Iterable.<Node>
Gets child nodes iterator.
Returns
Iterable.<Node>
Child nodes iterator.
-
is( type ) → Boolean
Checks whether given view tree object is of given type.
-
_fireChange( type, node )
private
Fires
change
event with given type of the change.