Преглед изворни кода

Reverted changes in the EditingController. Handled in #1661.

Aleksander Nowodzinski пре 7 година
родитељ
комит
e944ca51fa

+ 0 - 7
packages/ckeditor5-engine/src/controller/editingcontroller.js

@@ -69,13 +69,6 @@ export default class EditingController {
 		const selection = doc.selection;
 		const markers = this.model.markers;
 
-		// When taking over an editing view, disable the rendering until the first
-		// changes were made to the model. This allows a free manipulation of the view root
-		// attributes without any risk of breaking anything, for instance, the initial content
-		// of the DOM root element. If the rendering was allowed, any change of attributes would
-		// trigger rendering and synchronize the DOM root with a (still) empty model.
-		this.view._renderingDisabled = true;
-
 		// When plugins listen on model changes (on selection change, post fixers, etc) and change the view as a result of
 		// model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
 		// is converted). We disable rendering for the length of the outermost model change() block to prevent that.

+ 0 - 27
packages/ckeditor5-engine/tests/controller/editingcontroller.js

@@ -348,33 +348,6 @@ describe( 'EditingController', () => {
 				.to.equal( '<p></p><p>f<span>oo</span></p><p>bar</p>' );
 		} );
 
-		it( 'should prevent rendering of a fresh view until the first changes mere made to the model', () => {
-			const model = new Model();
-			model.document.createRoot();
-
-			const editing = new EditingController( model );
-			const domRoot = document.createElement( 'div' );
-			domRoot.contentEditable = true;
-
-			document.body.appendChild( domRoot );
-
-			const viewRoot = editing.view.document.getRoot();
-			editing.view.attachDomRoot( domRoot );
-
-			editing.view.change( writer => {
-				writer.setAttribute( 'new-attribute', 'foo', viewRoot );
-			} );
-
-			expect( domRoot.hasAttribute( 'new-attribute' ) ).to.be.false;
-
-			model.change( () => {} );
-
-			expect( domRoot.getAttribute( 'new-attribute' ) ).to.equal( 'foo' );
-
-			document.body.removeChild( domRoot );
-			editing.destroy();
-		} );
-
 		describe( 'preventing rendering while in the model.change() block', () => {
 			let renderSpy;
 

+ 1 - 1
packages/ckeditor5-engine/tests/view/view/view.js

@@ -211,7 +211,7 @@ describe( 'view', () => {
 			const viewRoot = createViewRoot( viewDocument, 'div', 'main' );
 
 			view.attachDomRoot( domDiv );
-			view.render();
+			view.forceRender();
 
 			viewRoot.isReadOnly = false;
 			expect( domDiv.getAttribute( 'contenteditable' ) ).to.equal( 'true' );