Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Updated API docs and inline comments. #17518

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ckeditor5-engine/src/conversion/upcastdispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ export default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
* as some elements might have become empty after other empty elements were removed from them.
*/
private _removeEmptyElements(): void {
// For every parent, prepare an array of children (empty elements) to remove from it.
// Then, in next step, we will remove all children together, which is faster than removing them one by one.
const toRemove = new Map<ModelElement | ModelDocumentFragment, Array<ModelElement>>();

for ( const element of this._splitParts.keys() ) {
Expand Down
4 changes: 4 additions & 0 deletions packages/ckeditor5-engine/src/model/documentfragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ export default class DocumentFragment extends TypeCheckable implements Iterable<
* Removes children nodes provided as an array and sets
* the {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
*
* These nodes do not need to be direct siblings.
*
* This method is faster than removing nodes one by one, as it recalculates offsets only once.
*
* @internal
* @param nodes Array of nodes.
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/ckeditor5-engine/src/model/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ export default class Element extends Node {
* Removes children nodes provided as an array and sets
* the {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
*
* These nodes do not need to be direct siblings.
*
* This method is faster than removing nodes one by one, as it recalculates offsets only once.
*
* @internal
* @param nodes Array of nodes.
*/
Expand Down
4 changes: 3 additions & 1 deletion packages/ckeditor5-engine/src/model/nodelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ export default class NodeList implements Iterable<Node> {
}

/**
* Removes children nodes provided as an array.
* Removes children nodes provided as an array. These nodes do not need to be direct siblings.
*
* This method is faster than removing nodes one by one, as it recalculates offsets only once.
*
* @internal
* @param nodes Array of nodes.
Expand Down