浏览代码

Updated documentation.

Szymon Kupś 7 年之前
父节点
当前提交
fb04992c5e

+ 7 - 1
packages/ckeditor5-engine/src/view/observer/domeventdata.js

@@ -21,13 +21,19 @@ export default class DomEventData {
 	 * @param {Object} [additionalData] Additional properties that the instance should contain.
 	 */
 	constructor( view, domEvent, additionalData ) {
+		/**
+		 * Instance of the view controller.
+		 *
+		 * @readonly
+		 * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view
+		 */
 		this.view = view;
 
 		/**
 		 * The instance of the document.
 		 *
 		 * @readonly
-		 * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#view
+		 * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#document
 		 */
 		this.document = view.document;
 

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

@@ -24,6 +24,12 @@ export default class Observer {
 	 * @param {module:engine/view/view~View} view
 	 */
 	constructor( view ) {
+		/**
+		 * Instance of the view controller.
+		 *
+		 * @readonly
+		 * @member {module:engine/view/view~View}
+		 */
 		this.view = view;
 
 		/**

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

@@ -110,8 +110,6 @@ export default class Renderer {
 		 * @type {null|HTMLElement}
 		 */
 		this._fakeSelectionContainer = null;
-
-		// TODO: document render event.
 		this.decorate( 'render' );
 	}
 

+ 2 - 1
packages/ckeditor5-engine/src/view/view.js

@@ -295,7 +295,8 @@ export default class View {
 	change( callback ) {
 		if ( this._renderingInProgress ) {
 			/**
-			 * TODO: description - there might be a view change triggered during rendering process.
+			 * Warning displayed when there is an attempt to make changes in the view tree during the rendering process.
+			 * This may cause unexpected behaviour and inconsistency between the DOM and the view.
 			 *
 			 * @error applying-view-changes-on-rendering
 			 */

+ 10 - 0
packages/ckeditor5-engine/tests/view/renderer.js

@@ -140,6 +140,16 @@ describe( 'Renderer', () => {
 			domRoot.remove();
 		} );
 
+		it( 'should be decorated', () => {
+			const spy = sinon.spy();
+
+			renderer.on( 'render', spy );
+
+			renderer.render();
+
+			expect( spy.calledOnce ).to.be.true;
+		} );
+
 		it( 'should update attributes', () => {
 			viewRoot.setAttribute( 'class', 'foo' );