Przeglądaj źródła

Remove private _parseStyle() method.

Maciej Gołaszewski 6 lat temu
rodzic
commit
379c66c938
1 zmienionych plików z 13 dodań i 16 usunięć
  1. 13 16
      packages/ckeditor5-engine/src/view/styles.js

+ 13 - 16
packages/ckeditor5-engine/src/view/styles.js

@@ -72,7 +72,14 @@ export default class Styles {
 	 */
 	setStyle( styleString = '' ) {
 		this.clear();
-		this._parseStyle( styleString );
+
+		const map = parseInlineStyles( styleString );
+
+		for ( const key of map.keys() ) {
+			const value = map.get( key );
+
+			this._parseProperty( key, value );
+		}
 	}
 
 	/**
@@ -147,19 +154,19 @@ export default class Styles {
 	}
 
 	getInlineProperty( name ) {
-		const model = this.getNormalized( name );
+		const normalized = this.getNormalized( name );
 
-		if ( !model ) {
+		if ( !normalized ) {
 			// Try return directly
 			return this._styles[ name ];
 		}
 
-		if ( isObject( model ) ) {
-			return toInlineStyle( name, model, true );
+		if ( isObject( normalized ) ) {
+			return toInlineStyle( name, normalized, true );
 		}
 		// String value
 		else {
-			return model;
+			return normalized;
 		}
 	}
 
@@ -173,16 +180,6 @@ export default class Styles {
 		this._styles = {};
 	}
 
-	_parseStyle( string ) {
-		const map = parseInlineStyles( string );
-
-		for ( const key of map.keys() ) {
-			const value = map.get( key );
-
-			this._parseProperty( key, value );
-		}
-	}
-
 	_appendStyleValue( nameOrPath, valueOrObject ) {
 		if ( typeof valueOrObject === 'object' ) {
 			if ( nameOrPath.includes( '.' ) ) {