Piotr Jasiun преди 10 години
родител
ревизия
a6027633e5

+ 1 - 1
packages/ckeditor5-utils/src/document/attribute.js

@@ -43,7 +43,7 @@ CKEDITOR.define( [ 'utils' ], function( utils ) {
 			 * @private
 			 * @property {String} _hash
 			 */
-			this._hash = JSON.stringify( this.key ) + ': ' + JSON.stringify( this.value, sort );
+			this._hash = this.key + ': ' + JSON.stringify( this.value, sort );
 
 			// If attribute is registered the registered one should be returned.
 			if ( Attribute._register[ this._hash ] ) {

+ 4 - 4
packages/ckeditor5-utils/src/document/changeoperation.js

@@ -25,8 +25,8 @@ CKEDITOR.define( [ 'document/operation', 'ckeditorerror', 'utils' ], function( O
 		 * old attributes have to have the same key and the old attribute must be present in all nodes in ranges.
 		 *
 		 * @param {Array|document.Range} ranges Range or array of ranges on which operation should be applied.
-		 * @param {document.Attribute|Null} oldAttr Old attribute to change. Null if operation inserts new attribute.
-		 * @param {document.Attribute|Null} newAttr New attribute. Null if operation removes attribute.
+		 * @param {document.Attribute|null} oldAttr Old attribute to change. Null if operation inserts new attribute.
+		 * @param {document.Attribute|null} newAttr New attribute. Null if operation removes attribute.
 		 * @param {Number} baseVersion {@link document.Document#version} on which operation can be applied.
 		 * @constructor
 		 */
@@ -45,7 +45,7 @@ CKEDITOR.define( [ 'document/operation', 'ckeditorerror', 'utils' ], function( O
 			 * Old attribute to change. Null if operation inserts new attribute.
 			 *
 			 * @readonly
-			 * @type {document.Attribute|Null}
+			 * @type {document.Attribute|null}
 			 */
 			this.oldAttr = oldAttr;
 
@@ -53,7 +53,7 @@ CKEDITOR.define( [ 'document/operation', 'ckeditorerror', 'utils' ], function( O
 			 * New attribute. Null if operation removes attribute.
 			 *
 			 * @readonly
-			 * @type {document.Attribute|Null}
+			 * @type {document.Attribute|null}
 			 */
 			this.newAttr = newAttr;
 		}

+ 1 - 0
packages/ckeditor5-utils/src/document/insertoperation.js

@@ -56,6 +56,7 @@ CKEDITOR.define( [ 'document/operation', 'document/nodelist', 'document/removeop
 		 * @returns {document.RemoveOperation} Reverse operation.
 		 */
 		reverseOperation() {
+			// Because of circular dependencies we need to re-require remove operation here.
 			var RemoveOperation = CKEDITOR.require( 'document/removeoperation' );
 
 			return new RemoveOperation( this.position, this.nodeList, this.baseVersion + 1 );

+ 5 - 5
packages/ckeditor5-utils/src/document/node.js

@@ -24,9 +24,9 @@ CKEDITOR.define( [ 'document/attribute', 'utils' ], function( Attribute, utils )
 		 */
 		constructor( attrs ) {
 			/**
-			 * Parent element. Null by default.
+			 * Parent element. Null by default. Set by {@link document.Element#insertChildren}.
 			 *
-			 * @property {document.Element|Null} parent
+			 * @property {document.Element|null} parent
 			 */
 			this.parent = null;
 
@@ -75,7 +75,7 @@ CKEDITOR.define( [ 'document/attribute', 'utils' ], function( Attribute, utils )
 		 * Returns attribute if node contain attribute with the same key and value as given or the same key if the
 		 * given parameter is a string.
 		 *
-		 * @param {document.Attribute|String|Null} attr Attribute or key to compare.
+		 * @param {document.Attribute|String|null} attr Attribute or key to compare.
 		 * @returns {document.Attribute} Attribute if node contains given attribute or attribute with given key,
 		 * or null if attribute was not found.
 		 */
@@ -187,7 +187,7 @@ CKEDITOR.define( [ 'document/attribute', 'utils' ], function( Attribute, utils )
 		 * Nodes next sibling or null if it is the last child.
 		 *
 		 * @readonly
-		 * @property {document.Node|Null} nextSibling
+		 * @property {document.Node|null} nextSibling
 		 */
 		get nextSibling() {
 			var pos = this.positionInParent;
@@ -199,7 +199,7 @@ CKEDITOR.define( [ 'document/attribute', 'utils' ], function( Attribute, utils )
 		 * Nodes previous sibling or null if it is the last child.
 		 *
 		 * @readonly
-		 * @property {document.Node|Null} previousSibling
+		 * @property {document.Node|null} previousSibling
 		 */
 		get previousSibling() {
 			var pos = this.positionInParent;

+ 1 - 0
packages/ckeditor5-utils/src/document/removeoperation.js

@@ -88,6 +88,7 @@ CKEDITOR.define( [
 		 * @returns {document.InsertOperation} Reverse operation.
 		 */
 		reverseOperation() {
+			// Because of circular dependencies we need to re-require insert operation here.
 			var InsertOperation = CKEDITOR.require( 'document/insertoperation' );
 
 			return new InsertOperation( this.position, this.nodeList, this.baseVersion + 1 );