Jelajahi Sumber

Docs fixes in view Element and Writer classes.

Szymon Kupś 8 tahun lalu
induk
melakukan
a4e65b34cf

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

@@ -676,7 +676,7 @@ export default class Element extends Node {
 	/**
 	 * Returns identity string based on element's name, styles, classes and other attributes.
 	 * Two elements that {@link #isSimilar are similar} will have same identity string.
-	 * It has following format:
+	 * It has the following format:
 	 *
 	 *		"name|classes(class1,class2,class3)|styles(style1=val1,style2=val2)|attributes(attr1=val1,attr2=val2)"
  	 *

+ 3 - 1
packages/ckeditor5-engine/src/view/writer.js

@@ -990,11 +990,13 @@ function shouldABeOutsideB( a, b ) {
 		return false;
 	}
 
+	// Two attribute elements with same priority and name will be merged into one element so there is no need to preserve
+	// order in such situations.
 	if ( a.name == b.name ) {
 		return true;
 	}
 
-	// When priorities are equal use identities.
+	// When priorities are equal and names are different - use identities.
 	return a.getIdentity() < b.getIdentity();
 }