From 2811575df3bab762422a351f6b6ec6af980a68d2 Mon Sep 17 00:00:00 2001 From: Szymon Cofalik Date: Tue, 6 Mar 2018 15:32:05 +0100 Subject: [PATCH] Docs: Added more explanation. --- src/model/writer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/model/writer.js b/src/model/writer.js index f7e7fb622..aee0b05fc 100644 --- a/src/model/writer.js +++ b/src/model/writer.js @@ -176,8 +176,11 @@ export default class Writer { // If it isn't the same root. else { if ( item.root.document ) { + // It is forbidden to move a node that was already in a document outside of it. throw new Error( 'model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.' ); } else { + // Move between two different document fragments or from document fragment to a document is possible. + // In that case, remove the item from it's original parent. this.remove( item ); } }