Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Adjusted code to changes in i/6091 #218

Merged
merged 9 commits into from
Mar 3, 2020
7 changes: 5 additions & 2 deletions src/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import EditingKeystrokeHandler from '../editingkeystrokehandler';
import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
import { StylesProcessor } from '@ckeditor/ckeditor5-engine/src/view/stylesmap';

/**
* The class representing a basic, generic editor.
Expand Down Expand Up @@ -161,14 +162,16 @@ export default class Editor {
*/
this.model = new Model();

const stylesProcessor = new StylesProcessor();

/**
* The {@link module:engine/controller/datacontroller~DataController data controller}.
* Used e.g. for setting and retrieving the editor data.
*
* @readonly
* @member {module:engine/controller/datacontroller~DataController}
*/
this.data = new DataController( this.model );
this.data = new DataController( this.model, stylesProcessor );

/**
* The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
Expand All @@ -177,7 +180,7 @@ export default class Editor {
* @readonly
* @member {module:engine/controller/editingcontroller~EditingController}
*/
this.editing = new EditingController( this.model );
this.editing = new EditingController( this.model, stylesProcessor );
this.editing.view.document.bind( 'isReadOnly' ).to( this );

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/_utils/classictesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class ClassicTestEditor extends Editor {
}

// Use the HTML data processor in this editor.
this.data.processor = new HtmlDataProcessor();
this.data.processor = new HtmlDataProcessor( this.editing.view.document );

// Create the ("main") root element of the model tree.
this.model.document.createRoot();
Expand Down
2 changes: 1 addition & 1 deletion tests/_utils/modeltesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.data.processor = new HtmlDataProcessor( this.editing.view.document );

// Disable editing pipeline.
this.editing.destroy();
Expand Down
2 changes: 1 addition & 1 deletion tests/_utils/virtualtesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.data.processor = new HtmlDataProcessor( this.editing.view.document );

// Create the ("main") root element of the model tree.
this.model.document.createRoot();
Expand Down
2 changes: 1 addition & 1 deletion tests/editor/utils/attachtoform.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe( 'attachToForm()', () => {
mix( CustomEditor, ElementApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.data.processor = new HtmlDataProcessor( editor.editing.view.document );
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
editor.fire( 'ready' );
Expand Down
2 changes: 1 addition & 1 deletion tests/editor/utils/dataapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe( 'DataApiMixin', () => {
mix( CustomEditor, DataApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.data.processor = new HtmlDataProcessor( editor.editing.view.document );
editor.model.document.createRoot( '$root', 'main' );
editor.model.document.createRoot( '$root', 'secondRoot' );
editor.model.schema.extend( '$text', { allowIn: '$root' } );
Expand Down
2 changes: 1 addition & 1 deletion tests/editor/utils/elementapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe( 'ElementApiMixin', () => {
mix( CustomEditor, ElementApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor();
editor.data.processor = new HtmlDataProcessor( editor.editing.view.document );
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
editor.fire( 'ready' ); // (#6139)
Expand Down