Szymon Kupś 9 anni fa
parent
commit
3cca2f1030

+ 0 - 4
packages/ckeditor5-engine/src/view/attributeelement.js

@@ -42,10 +42,6 @@ export default class AttributeElement extends Element {
 
 
 		/**
 		/**
 		 * Returns block {@link module:engine/view/filter~Filter filler} offset or `null` if block filler is not needed.
 		 * Returns block {@link module:engine/view/filter~Filter filler} offset or `null` if block filler is not needed.
-		 * This method is implemented in a constructor because it is treated as an injected behaviour and it might be
-		 * changed during execution (in elements representing widgets for example).
-		 * When {@link module:engine/view/element~Element.clone element is cloned}, this method will be referenced from
-		 * source object.
 		 *
 		 *
 		 * @method #getFillerOffset
 		 * @method #getFillerOffset
 		 * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
 		 * @returns {Number|null} Block filler offset or `null` if block filler is not needed.

+ 0 - 4
packages/ckeditor5-engine/src/view/containerelement.js

@@ -55,10 +55,6 @@ export default class ContainerElement extends Element {
 
 
 		/**
 		/**
 		 * Returns block {@link module:engine/view/filter~Filter filler} offset or `null` if block filler is not needed.
 		 * Returns block {@link module:engine/view/filter~Filter filler} offset or `null` if block filler is not needed.
-		 * This method is implemented in a constructor because it is treated as an injected behaviour and it might be
-		 * changed during execution (in elements representing widgets for example).
-		 * When {@link module:engine/view/element~Element.clone element is cloned}, this method will be referenced from
-		 * source object.
 		 *
 		 *
 		 * @method #getFillerOffset
 		 * @method #getFillerOffset
 		 * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
 		 * @returns {Number|null} Block filler offset or `null` if block filler is not needed.

+ 14 - 8
packages/ckeditor5-engine/src/view/element.js

@@ -163,10 +163,8 @@ export default class Element extends Node {
 		// Clone custom properties.
 		// Clone custom properties.
 		cloned._customProperties = new Map( this._customProperties );
 		cloned._customProperties = new Map( this._customProperties );
 
 
-		// Clone filler offset method if one exists.
-		if ( this.getFillerOffset ) {
-			cloned.getFillerOffset = this.getFillerOffset;
-		}
+		// Clone filler offset method.
+		cloned.getFillerOffset = this.getFillerOffset;
 
 
 		return cloned;
 		return cloned;
 	}
 	}
@@ -616,7 +614,7 @@ export default class Element extends Node {
 	}
 	}
 
 
 	/**
 	/**
-	 * Sets custom property.
+	 * Sets a custom property.
 	 *
 	 *
 	 * @param {String|Symbol} key
 	 * @param {String|Symbol} key
 	 * @param {*} value
 	 * @param {*} value
@@ -626,7 +624,7 @@ export default class Element extends Node {
 	}
 	}
 
 
 	/**
 	/**
-	 * Returns custom property value for given key.
+	 * Returns the custom property value for the given key.
 	 *
 	 *
 	 * @param {String|Symbol} key
 	 * @param {String|Symbol} key
 	 * @returns {*}
 	 * @returns {*}
@@ -636,7 +634,7 @@ export default class Element extends Node {
 	}
 	}
 
 
 	/**
 	/**
-	 * Removes custom property stored under given key.
+	 * Removes the custom property stored under the given key.
 	 *
 	 *
 	 * @param {String|Symbol} key
 	 * @param {String|Symbol} key
 	 * @returns {Boolean} Returns true if property was removed.
 	 * @returns {Boolean} Returns true if property was removed.
@@ -646,13 +644,21 @@ export default class Element extends Node {
 	}
 	}
 
 
 	/**
 	/**
-	 * Returns iterator that iterates over this element's custom properties.
+	 * Returns an iterator which iterates over this element's custom properties.
+	 * Iterator provides [key, value] pair for each stored property.
 	 *
 	 *
 	 * @returns {Iterable.<*>}
 	 * @returns {Iterable.<*>}
 	 */
 	 */
 	*getCustomProperties() {
 	*getCustomProperties() {
 		yield* this._customProperties.entries();
 		yield* this._customProperties.entries();
 	}
 	}
+
+	/**
+	 * Returns block {@link module:engine/view/filter~Filter filler} offset or `null` if block filler is not needed.
+	 *
+	 * @abstract
+	 * @method module:engine/view/element~Element#getFillerOffset
+	 */
 }
 }
 
 
 // Parses inline styles and puts property - value pairs into styles map.
 // Parses inline styles and puts property - value pairs into styles map.

+ 1 - 5
packages/ckeditor5-engine/src/view/emptyelement.js

@@ -31,11 +31,7 @@ export default class EmptyElement extends Element {
 		}
 		}
 
 
 		/**
 		/**
-		 * Returns `null` because filler is not needed.
-		 * This method is implemented in a constructor because it is treated as an injected behaviour and it might be
-		 * changed during execution (in elements representing widgets for example).
-		 * When {@link module:engine/view/element~Element.clone element is cloned}, this method will be referenced from
-		 * source object.
+		 * Returns `null` because filler is not needed for EmptyElements.
 		 *
 		 *
 		 * @method #getFillerOffset
 		 * @method #getFillerOffset
 		 * @returns {null} Always returns null.
 		 * @returns {null} Always returns null.