Skip to content

Commit

Permalink
Merge pull request #8840 from ckeditor/i/8834
Browse files Browse the repository at this point in the history
Tests: Remove unnecessary processor initialization. Closes #8834.

Docs: Remove unnecessary processor initialization in examples and snippets. Closes #8834.
  • Loading branch information
Reinmar authored Jan 15, 2021
2 parents 4129bad + 7969036 commit dffc1eb
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 35 deletions.
3 changes: 0 additions & 3 deletions docs/_snippets/examples/multi-root-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Multiroot editor dependencies.
import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';
import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement';
import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
Expand Down Expand Up @@ -66,8 +65,6 @@ class MultirootEditor extends Editor {
constructor( sourceElements, config ) {
super( config );

this.data.processor = new HtmlDataProcessor( this.data.viewDocument );

// Create root and UIView element for each editable container.
for ( const rootName of Object.keys( sourceElements ) ) {
this.model.document.createRoot( '$root', rootName );
Expand Down
3 changes: 0 additions & 3 deletions docs/framework/guides/custom-editor-creator.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ The `*Editor` class is the main class of each editor type. It initializes the wh
```js
import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';
import DataApiMixin from '@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import getDataFromElement from '@ckeditor/ckeditor5-utils/src/dom/getdatafromelement';
import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
Expand Down Expand Up @@ -48,8 +47,6 @@ class MultirootEditor extends Editor {
constructor( sourceElements, config ) {
super( config );

this.data.processor = new HtmlDataProcessor( this.data.viewDocument );

// Create root and UIView element for each editable container.
for ( const rootName of Object.keys( sourceElements ) ) {
this.model.document.createRoot( '$root', rootName );
Expand Down
4 changes: 0 additions & 4 deletions packages/ckeditor5-core/tests/_utils/classictesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import Editor from '../../src/editor/editor';
import ElementApiMixin from '../../src/editor/utils/elementapimixin';
import DataApiMixin from '../../src/editor/utils/dataapimixin';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import EditorUI from '../../src/editor/editorui';
import BoxedEditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview';
import ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer';
Expand All @@ -33,9 +32,6 @@ export default class ClassicTestEditor extends Editor {
this.sourceElement = sourceElementOrData;
}

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

// Create the ("main") root element of the model tree.
this.model.document.createRoot();

Expand Down
4 changes: 0 additions & 4 deletions packages/ckeditor5-core/tests/_utils/modeltesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import Editor from '../../src/editor/editor';
import DataApiMixin from '../../src/editor/utils/dataapimixin';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import mix from '@ckeditor/ckeditor5-utils/src/mix';

/**
Expand All @@ -20,9 +19,6 @@ export default class ModelTestEditor extends Editor {
constructor( config ) {
super( config );

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

// Disable editing pipeline.
this.editing.destroy();

Expand Down
4 changes: 0 additions & 4 deletions packages/ckeditor5-core/tests/_utils/virtualtesteditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import Editor from '../../src/editor/editor';
import DataApiMixin from '../../src/editor/utils/dataapimixin';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import mix from '@ckeditor/ckeditor5-utils/src/mix';

/**
Expand All @@ -20,9 +19,6 @@ export default class VirtualTestEditor extends Editor {
constructor( config ) {
super( config );

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

// Create the ("main") root element of the model tree.
this.model.document.createRoot();
}
Expand Down
2 changes: 0 additions & 2 deletions packages/ckeditor5-core/tests/editor/utils/attachtoform.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import attachToForm from '../../../src/editor/utils/attachtoform';
import ElementApiMixin from '../../../src/editor/utils/elementapimixin';
import Editor from '../../../src/editor/editor';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';

Expand All @@ -31,7 +30,6 @@ describe( 'attachToForm()', () => {
mix( CustomEditor, ElementApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor( editor.data.viewDocument );
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
editor.fire( 'ready' );
Expand Down
2 changes: 0 additions & 2 deletions packages/ckeditor5-core/tests/editor/utils/dataapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import DataApiMixin from '../../../src/editor/utils/dataapimixin';
import Editor from '../../../src/editor/editor';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import testUtils from '../../../tests/_utils/utils';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
import { getData, setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
Expand All @@ -18,7 +17,6 @@ describe( 'DataApiMixin', () => {
mix( CustomEditor, DataApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor( editor.data.viewDocument );
editor.model.document.createRoot( '$root', 'main' );
editor.model.document.createRoot( '$root', 'secondRoot' );
editor.model.schema.extend( '$text', { allowIn: '$root' } );
Expand Down
2 changes: 0 additions & 2 deletions packages/ckeditor5-core/tests/editor/utils/elementapimixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import ElementApiMixin from '../../../src/editor/utils/elementapimixin';
import Editor from '../../../src/editor/editor';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import mix from '@ckeditor/ckeditor5-utils/src/mix';
import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';

Expand All @@ -21,7 +20,6 @@ describe( 'ElementApiMixin', () => {
mix( CustomEditor, ElementApiMixin );

editor = new CustomEditor();
editor.data.processor = new HtmlDataProcessor( editor.data.viewDocument );
editor.model.document.createRoot();
editor.model.schema.extend( '$text', { allowIn: '$root' } );
editor.fire( 'ready' ); // (#6139)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';
import EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui';
import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview';
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer';

// Interfaces to extend basic Editor API.
Expand Down Expand Up @@ -51,9 +50,6 @@ export default class BootstrapEditor extends Editor {
// Remember the element the editor is created with.
this.sourceElement = element;

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

// Create the ("main") root element of the model tree.
this.model.document.createRoot();

Expand Down
4 changes: 0 additions & 4 deletions packages/ckeditor5-ui/docs/framework/guides/external-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview';
import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory';
import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
import ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer';

// Interfaces to extend the basic Editor API.
Expand Down Expand Up @@ -70,9 +69,6 @@ export default class BootstrapEditor extends Editor {
// Remember the element the editor is created with.
this.sourceElement = element;

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

// Create the ("main") root element of the model tree.
this.model.document.createRoot();

Expand Down
3 changes: 0 additions & 3 deletions packages/ckeditor5-watchdog/tests/editorwatchdog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';
import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';

// The error handling testing with mocha & chai is quite broken and hard to test.
// sinon.stub( window, 'onerror' ).value( undefined ); and similar do not work.
Expand Down Expand Up @@ -937,8 +936,6 @@ describe( 'EditorWatchdog', () => {
constructor( sourceElements, config ) {
super( config );

this.data.processor = new HtmlDataProcessor( this.data.viewDocument );

// Create a root for each source element.
for ( const rootName of Object.keys( sourceElements ) ) {
this.model.document.createRoot( '$root', rootName );
Expand Down

0 comments on commit dffc1eb

Please sign in to comment.