Przeglądaj źródła

Removed writer.createElement() method.

Szymon Kupś 7 lat temu
rodzic
commit
3bc0e1b288

+ 0 - 15
packages/ckeditor5-engine/src/view/writer.js

@@ -17,7 +17,6 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import DocumentFragment from './documentfragment';
 import isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';
 import Text from './text';
-import Element from './element';
 import EditableElement from './editableelement';
 
 /**
@@ -110,20 +109,6 @@ export default class Writer {
 	}
 
 	/**
-	 * Creates new {@link module:engine/view/element~Element element}.
-	 *
-	 *		writer.createElement( 'paragraph' );
-	 *		writer.createElement( 'paragraph', { 'alignment': 'center' } );
-	 *
-	 * @param {String} name Name of the element.
-	 * @param {Object} [attributes] Elements attributes.
-	 * @returns {module:engine/view/element~Element} Created element.
-	 */
-	createElement( name, attributes ) {
-		return new Element( name, attributes );
-	}
-
-	/**
 	 * Creates new {@link module:engine/view/attributeelement~AttributeElement}.
 	 *
 	 *		writer.createAttributeElement( 'paragraph' );

+ 0 - 10
packages/ckeditor5-engine/tests/view/writer/writer.js

@@ -60,16 +60,6 @@ describe( 'Writer', () => {
 		} );
 	} );
 
-	describe( 'createElement()', () => {
-		it( 'should create Element', () => {
-			const element = writer.createElement( 'foo', attributes );
-
-			expect( element.is( 'element' ) ).to.be.true;
-			expect( element.name ).to.equal( 'foo' );
-			assertElementAttributes( element, attributes );
-		} );
-	} );
-
 	describe( 'createAttributeElement()', () => {
 		it( 'should create AttributeElement', () => {
 			const element = writer.createAttributeElement( 'foo', attributes );