Przeglądaj źródła

Merge pull request #1641 from ckeditor/t/454

Internal: Reverted changes introduced due to the bug in Chrome@51. Closes #454.
Piotrek Koszuliński 7 lat temu
rodzic
commit
66c765e8d8

+ 2 - 3
packages/ckeditor5-engine/src/model/documentselection.js

@@ -1017,10 +1017,9 @@ class LiveSelection extends Selection {
 					break;
 				}
 
-				// This is not an optimal solution because of https://github.com/ckeditor/ckeditor5-engine/issues/454.
-				// It can be done better by using `break;` instead of checking `attrs === null`.
-				if ( value.type == 'text' && attrs === null ) {
+				if ( value.type == 'text' ) {
 					attrs = value.item.getAttributes();
+					break;
 				}
 			}
 		} else {

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

@@ -206,11 +206,7 @@ export default class Element extends Node {
 			yield 'style';
 		}
 
-		// This is not an optimal solution because of https://github.com/ckeditor/ckeditor5-engine/issues/454.
-		// It can be simplified to `yield* this._attrs.keys();`.
-		for ( const key of this._attrs.keys() ) {
-			yield key;
-		}
+		yield* this._attrs.keys();
 	}
 
 	/**