Răsfoiți Sursa

StylesProcessor is no longer a property of the core Editor class.

Kamil Piechaczek 6 ani în urmă
părinte
comite
d80c4d56dc

+ 4 - 10
packages/ckeditor5-core/src/editor/editor.js

@@ -52,6 +52,8 @@ export default class Editor {
 	 * @param {Object} [config={}] The editor configuration.
 	 */
 	constructor( config = {} ) {
+		const stylesProcessor = new StylesProcessor();
+
 		/**
 		 * The editor context.
 		 * When it is not provided through the configuration, the editor creates it.
@@ -162,14 +164,6 @@ export default class Editor {
 		 */
 		this.model = new Model();
 
-		/**
-		 * StylesProcessor is responsible for writing and reading a normalized styles object.
-		 *
-		 * @readonly
-		 * @member {module:engine/view/stylesmap~StylesProcessor}
-		 */
-		this.stylesProcessor = new StylesProcessor();
-
 		/**
 		 * The {@link module:engine/controller/datacontroller~DataController data controller}.
 		 * Used e.g. for setting and retrieving the editor data.
@@ -177,7 +171,7 @@ export default class Editor {
 		 * @readonly
 		 * @member {module:engine/controller/datacontroller~DataController}
 		 */
-		this.data = new DataController( this.model, this.stylesProcessor );
+		this.data = new DataController( this.model, stylesProcessor );
 
 		/**
 		 * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
@@ -186,7 +180,7 @@ export default class Editor {
 		 * @readonly
 		 * @member {module:engine/controller/editingcontroller~EditingController}
 		 */
-		this.editing = new EditingController( this.model, this.stylesProcessor );
+		this.editing = new EditingController( this.model, stylesProcessor );
 		this.editing.view.document.bind( 'isReadOnly' ).to( this );
 
 		/**

+ 1 - 1
packages/ckeditor5-core/tests/_utils/classictesteditor.js

@@ -34,7 +34,7 @@ export default class ClassicTestEditor extends Editor {
 		}
 
 		// Use the HTML data processor in this editor.
-		this.data.processor = new HtmlDataProcessor( this.stylesProcessor );
+		this.data.processor = new HtmlDataProcessor( this.data.stylesProcessor );
 
 		// Create the ("main") root element of the model tree.
 		this.model.document.createRoot();

+ 1 - 1
packages/ckeditor5-core/tests/_utils/modeltesteditor.js

@@ -21,7 +21,7 @@ export default class ModelTestEditor extends Editor {
 		super( config );
 
 		// Use the HTML data processor in this editor.
-		this.data.processor = new HtmlDataProcessor( this.stylesProcessor );
+		this.data.processor = new HtmlDataProcessor( this.data.stylesProcessor );
 
 		// Disable editing pipeline.
 		this.editing.destroy();

+ 1 - 1
packages/ckeditor5-core/tests/_utils/virtualtesteditor.js

@@ -21,7 +21,7 @@ export default class VirtualTestEditor extends Editor {
 		super( config );
 
 		// Use the HTML data processor in this editor.
-		this.data.processor = new HtmlDataProcessor( this.stylesProcessor );
+		this.data.processor = new HtmlDataProcessor( this.data.stylesProcessor );
 
 		// Create the ("main") root element of the model tree.
 		this.model.document.createRoot();