From faac1f653453db8a875f5fd2c34b9a66cc2b3e70 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 22 Jan 2019 09:17:43 +0100 Subject: [PATCH] Reverted changes introduced due to bug in Chrome@51. --- src/model/documentselection.js | 5 ++--- src/view/element.js | 6 +----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/model/documentselection.js b/src/model/documentselection.js index 258f7524a..128920434 100644 --- a/src/model/documentselection.js +++ b/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 { diff --git a/src/view/element.js b/src/view/element.js index 8e4636e0f..5282439c9 100644 --- a/src/view/element.js +++ b/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(); } /**