Parcourir la source

Added: comments in code.

Szymon Cofalik il y a 9 ans
Parent
commit
d562b0d821

+ 2 - 0
packages/ckeditor5-engine/src/view/observer/mutationobserver.js

@@ -193,6 +193,8 @@ export default class MutationObserver extends Observer {
 
 
 		this.document.fire( 'mutations', viewMutations );
 		this.document.fire( 'mutations', viewMutations );
 
 
+		// If nothing changes on `mutations` event, at this point we have "dirty DOM" (changed) and de-synched
+		// view (which has not been changed). In order to "reset DOM" we render the view again.
 		this.document.render();
 		this.document.render();
 	}
 	}
 }
 }

+ 2 - 0
packages/ckeditor5-engine/src/view/observer/selectionobserver.js

@@ -153,6 +153,8 @@ export default class SelectionObserver extends Observer {
 			domSelection: domSelection
 			domSelection: domSelection
 		} );
 		} );
 
 
+		// If nothing changes on `selectionChange` event, at this point we have "dirty DOM" (changed) and de-synched
+		// view (which has not been changed). In order to "reset DOM" we render the view again.
 		this.document.render();
 		this.document.render();
 	}
 	}