Przeglądaj źródła

Renamed `ELEMENT_START` and `ELEMENT_END` to lower case.

Oskar Wrobel 9 lat temu
rodzic
commit
87476d365a

+ 1 - 1
packages/ckeditor5-engine/src/model/composer/modifyselection.js

@@ -48,7 +48,7 @@ export default function modifySelection( selection, options = {} ) {
 	}
 	}
 
 
 	// 3. We're entering an element, so let's consume it fully.
 	// 3. We're entering an element, so let's consume it fully.
-	if ( value.type == ( isForward ? 'ELEMENT_START' : 'ELEMENT_END' ) ) {
+	if ( value.type == ( isForward ? 'elementStart' : 'elementEnd' ) ) {
 		selection.setFocus( value.item, isForward ? 'AFTER' : 'BEFORE' );
 		selection.setFocus( value.item, isForward ? 'AFTER' : 'BEFORE' );
 
 
 		return;
 		return;

+ 3 - 3
packages/ckeditor5-engine/src/model/range.js

@@ -48,12 +48,12 @@ export default class Range {
 	 * range.
 	 * range.
 	 *
 	 *
 	 * **Note:** iterator will not return a parent node of start position. This is in contrary to
 	 * **Note:** iterator will not return a parent node of start position. This is in contrary to
-	 * {@link engine.model.TreeWalker} which will return that node with `'ELEMENT_END'` type. Iterator also
+	 * {@link engine.model.TreeWalker} which will return that node with `'elementEnd'` type. Iterator also
 	 * returns each {@link engine.model.Element} once, while simply used {@link engine.model.TreeWalker} might
 	 * returns each {@link engine.model.Element} once, while simply used {@link engine.model.TreeWalker} might
-	 * return it twice: for `'ELEMENT_START'` and `'ELEMENT_END'`.
+	 * return it twice: for `'elementStart'` and `'elementEnd'`.
 	 *
 	 *
 	 * **Note:** because iterator does not return {@link engine.model.TreeWalkerValue values} with the type of
 	 * **Note:** because iterator does not return {@link engine.model.TreeWalkerValue values} with the type of
-	 * `'ELEMENT_END'`, you can use {@link engine.model.TreeWalkerValue.previousPosition} as a position before the
+	 * `'elementEnd'`, you can use {@link engine.model.TreeWalkerValue.previousPosition} as a position before the
 	 * item.
 	 * item.
 	 *
 	 *
 	 * @see engine.model.TreeWalker
 	 * @see engine.model.TreeWalker

+ 18 - 18
packages/ckeditor5-engine/src/model/treewalker.js

@@ -29,11 +29,11 @@ export default class TreeWalker {
 	 * should be returned one by one as multiple {@link engine.model.CharacterProxy} (`true`) objects or as one
 	 * should be returned one by one as multiple {@link engine.model.CharacterProxy} (`true`) objects or as one
 	 * {@link engine.model.TextProxy} (`false`).
 	 * {@link engine.model.TextProxy} (`false`).
 	 * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
 	 * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
-	 * iterator is shallow child nodes of any iterated node will not be returned along with `ELEMENT_END` tag.
-	 * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `ELEMENT_END`
+	 * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
+	 * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
 	 * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
 	 * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
 	 * each {@link engine.model.Element} will be returned once, while if the option is `false` they might be returned
 	 * each {@link engine.model.Element} will be returned once, while if the option is `false` they might be returned
-	 * twice: for `'ELEMENT_START'` and `'ELEMENT_END'`.
+	 * twice: for `'elementStart'` and `'elementEnd'`.
 	 */
 	 */
 	constructor( options = {} ) {
 	constructor( options = {} ) {
 		if ( !options.boundaries && !options.startPosition ) {
 		if ( !options.boundaries && !options.startPosition ) {
@@ -101,7 +101,7 @@ export default class TreeWalker {
 
 
 		/**
 		/**
 		 * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
 		 * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
-		 * iterated node will not be returned along with `ELEMENT_END` tag.
+		 * iterated node will not be returned along with `elementEnd` tag.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {Boolean} engine.model.TreeWalker#shallow
 		 * @member {Boolean} engine.model.TreeWalker#shallow
@@ -109,10 +109,10 @@ export default class TreeWalker {
 		this.shallow = !!options.shallow;
 		this.shallow = !!options.shallow;
 
 
 		/**
 		/**
-		 * Flag indicating whether iterator should ignore `ELEMENT_END` tags. If the option is true walker will not
+		 * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not
 		 * return a parent node of the start position. If this option is `true` each {@link engine.model.Element} will
 		 * return a parent node of the start position. If this option is `true` each {@link engine.model.Element} will
 		 * be returned once, while if the option is `false` they might be returned twice:
 		 * be returned once, while if the option is `false` they might be returned twice:
-		 * for `'ELEMENT_START'` and `'ELEMENT_END'`.
+		 * for `'elementStart'` and `'elementEnd'`.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {Boolean} engine.model.TreeWalker#ignoreElementEnd
 		 * @member {Boolean} engine.model.TreeWalker#ignoreElementEnd
@@ -201,7 +201,7 @@ export default class TreeWalker {
 
 
 			this.position = position;
 			this.position = position;
 
 
-			return formatReturnValue( 'ELEMENT_START', node, previousPosition, position, 1 );
+			return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
 		} else if ( node instanceof CharacterProxy ) {
 		} else if ( node instanceof CharacterProxy ) {
 			if ( this.singleCharacters ) {
 			if ( this.singleCharacters ) {
 				position.offset++;
 				position.offset++;
@@ -234,7 +234,7 @@ export default class TreeWalker {
 			if ( this.ignoreElementEnd ) {
 			if ( this.ignoreElementEnd ) {
 				return this._next();
 				return this._next();
 			} else {
 			} else {
-				return formatReturnValue( 'ELEMENT_END', parent, previousPosition, position );
+				return formatReturnValue( 'elementEnd', parent, previousPosition, position );
 			}
 			}
 		}
 		}
 	}
 	}
@@ -276,12 +276,12 @@ export default class TreeWalker {
 				if ( this.ignoreElementEnd ) {
 				if ( this.ignoreElementEnd ) {
 					return this._previous();
 					return this._previous();
 				} else {
 				} else {
-					return formatReturnValue( 'ELEMENT_END', node, previousPosition, position );
+					return formatReturnValue( 'elementEnd', node, previousPosition, position );
 				}
 				}
 			} else {
 			} else {
 				this.position = position;
 				this.position = position;
 
 
-				return formatReturnValue( 'ELEMENT_START', node, previousPosition, position, 1 );
+				return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
 			}
 			}
 		} else if ( node instanceof CharacterProxy ) {
 		} else if ( node instanceof CharacterProxy ) {
 			if ( this.singleCharacters ) {
 			if ( this.singleCharacters ) {
@@ -311,7 +311,7 @@ export default class TreeWalker {
 			this.position = position;
 			this.position = position;
 			this._visitedParent = parent.parent;
 			this._visitedParent = parent.parent;
 
 
-			return formatReturnValue( 'ELEMENT_START', parent, previousPosition, position, 1 );
+			return formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
 		}
 		}
 	}
 	}
 }
 }
@@ -331,7 +331,7 @@ function formatReturnValue( type, item, previousPosition, nextPosition, length )
 
 
 /**
 /**
  * Type of the step made by {@link engine.model.TreeWalker}.
  * Type of the step made by {@link engine.model.TreeWalker}.
- * Possible values: `'ELEMENT_START'` if walker is at the beginning of a node, `'ELEMENT_END'` if walker is at the end of node,
+ * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,
  * `'CHARACTER'` if walker traversed over a character, or `'TEXT'` if walker traversed over multiple characters (available in
  * `'CHARACTER'` if walker traversed over a character, or `'TEXT'` if walker traversed over multiple characters (available in
  * character merging mode, see {@link engine.model.TreeWalker#constructor}).
  * character merging mode, see {@link engine.model.TreeWalker#constructor}).
  *
  *
@@ -345,20 +345,20 @@ function formatReturnValue( type, item, previousPosition, nextPosition, length )
  * @property {engine.model.TreeWalkerValueType} type
  * @property {engine.model.TreeWalkerValueType} type
  * @property {engine.model.Item} item Item between old and new positions of {@link engine.model.TreeWalker}.
  * @property {engine.model.Item} item Item between old and new positions of {@link engine.model.TreeWalker}.
  * @property {engine.model.Position} previousPosition Previous position of the iterator.
  * @property {engine.model.Position} previousPosition Previous position of the iterator.
- * * Forward iteration: For `'ELEMENT_END'` it is the last position inside the element. For all other types it is the
+ * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  * position before the item. Note that it is more efficient to use this position then calculate the position before
  * position before the item. Note that it is more efficient to use this position then calculate the position before
  * the node using {@link engine.model.Position.createBefore}. It is also more efficient to get the
  * the node using {@link engine.model.Position.createBefore}. It is also more efficient to get the
  * position after node by shifting `previousPosition` by `length`, using {@link engine.model.Position#getShiftedBy},
  * position after node by shifting `previousPosition` by `length`, using {@link engine.model.Position#getShiftedBy},
  * then calculate the position using {@link engine.model.Position.createAfter}.
  * then calculate the position using {@link engine.model.Position.createAfter}.
- * * Backward iteration: For `'ELEMENT_START'` it is the first position inside the element. For all other types it is
+ * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  * the position after item.
  * the position after item.
  * @property {engine.model.Position} nextPosition Next position of the iterator.
  * @property {engine.model.Position} nextPosition Next position of the iterator.
- * * Forward iteration: For `'ELEMENT_START'` it is the first position inside the element. For all other types it is
+ * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  * the position after the item.
  * the position after the item.
- * * Backward iteration: For `'ELEMENT_END'` it is last position inside element. For all other types it is the position
+ * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  * before the item.
  * before the item.
- * @property {Number} [length] Length of the item. For `'ELEMENT_START'` and `'CHARACTER'` it is 1. For `'TEXT'` it is
- * the length of the text. For `'ELEMENT_END'` it is undefined.
+ * @property {Number} [length] Length of the item. For `'elementStart'` and `'CHARACTER'` it is 1. For `'TEXT'` it is
+ * the length of the text. For `'elementEnd'` it is undefined.
  */
  */
 
 
 /**
 /**

+ 19 - 19
packages/ckeditor5-engine/src/view/treewalker.js

@@ -29,11 +29,11 @@ export default class TreeWalker {
 	 * {@link engine.view.Text} should be returned as one {@link engine.view.Text} (`false`) ore one by one as
 	 * {@link engine.view.Text} should be returned as one {@link engine.view.Text} (`false`) ore one by one as
 	 * {@link engine.view.TextProxy} (`true`).
 	 * {@link engine.view.TextProxy} (`true`).
 	 * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
 	 * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
-	 * iterator is shallow child nodes of any iterated node will not be returned along with `ELEMENT_END` tag.
-	 * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `ELEMENT_END`
+	 * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
+	 * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
 	 * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
 	 * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
 	 * each {@link engine.view.Element} will be returned once, while if the option is `false` they might be returned
 	 * each {@link engine.view.Element} will be returned once, while if the option is `false` they might be returned
-	 * twice: for `'ELEMENT_START'` and `'ELEMENT_END'`.
+	 * twice: for `'elementStart'` and `'elementEnd'`.
 	 */
 	 */
 	constructor( options = {} ) {
 	constructor( options = {} ) {
 		if ( !options.boundaries && !options.startPosition ) {
 		if ( !options.boundaries && !options.startPosition ) {
@@ -97,7 +97,7 @@ export default class TreeWalker {
 
 
 		/**
 		/**
 		 * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
 		 * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
-		 * iterated node will not be returned along with `ELEMENT_END` tag.
+		 * iterated node will not be returned along with `elementEnd` tag.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {Boolean} engine.view.TreeWalker#shallow
 		 * @member {Boolean} engine.view.TreeWalker#shallow
@@ -105,9 +105,9 @@ export default class TreeWalker {
 		this.shallow = !!options.shallow;
 		this.shallow = !!options.shallow;
 
 
 		/**
 		/**
-		 * Flag indicating whether iterator should ignore `ELEMENT_END` tags. If set to `true`, walker will not
+		 * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not
 		 * return a parent node of the start position. Each {@link engine.view.Element} will be returned once.
 		 * return a parent node of the start position. Each {@link engine.view.Element} will be returned once.
-		 * When set to `false` each element might be returned twice: for `'ELEMENT_START'` and `'ELEMENT_END'`.
+		 * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.
 		 *
 		 *
 		 * @readonly
 		 * @readonly
 		 * @member {Boolean} engine.view.TreeWalker#ignoreElementEnd
 		 * @member {Boolean} engine.view.TreeWalker#ignoreElementEnd
@@ -194,7 +194,7 @@ export default class TreeWalker {
 
 
 			this.position = position;
 			this.position = position;
 
 
-			return this._formatReturnValue( 'ELEMENT_START', node, previousPosition, position, 1 );
+			return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
 		} else if ( node instanceof Text ) {
 		} else if ( node instanceof Text ) {
 			if ( this.singleCharacters ) {
 			if ( this.singleCharacters ) {
 				position = new Position( node, 0 );
 				position = new Position( node, 0 );
@@ -245,7 +245,7 @@ export default class TreeWalker {
 			if ( this.ignoreElementEnd ) {
 			if ( this.ignoreElementEnd ) {
 				return this._next();
 				return this._next();
 			} else {
 			} else {
-				return this._formatReturnValue( 'ELEMENT_END', parent, previousPosition, position );
+				return this._formatReturnValue( 'elementEnd', parent, previousPosition, position );
 			}
 			}
 		}
 		}
 	}
 	}
@@ -291,13 +291,13 @@ export default class TreeWalker {
 				if ( this.ignoreElementEnd ) {
 				if ( this.ignoreElementEnd ) {
 					return this._previous();
 					return this._previous();
 				} else {
 				} else {
-					return this._formatReturnValue( 'ELEMENT_END', node, previousPosition, position );
+					return this._formatReturnValue( 'elementEnd', node, previousPosition, position );
 				}
 				}
 			} else {
 			} else {
 				position.offset--;
 				position.offset--;
 				this.position = position;
 				this.position = position;
 
 
-				return this._formatReturnValue( 'ELEMENT_START', node, previousPosition, position, 1 );
+				return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
 			}
 			}
 		} else if ( node instanceof Text ) {
 		} else if ( node instanceof Text ) {
 			if ( this.singleCharacters ) {
 			if ( this.singleCharacters ) {
@@ -349,7 +349,7 @@ export default class TreeWalker {
 			position = Position.createBefore( parent );
 			position = Position.createBefore( parent );
 			this.position = position;
 			this.position = position;
 
 
-			return this._formatReturnValue( 'ELEMENT_START', parent, previousPosition, position, 1 );
+			return this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
 		}
 		}
 	}
 	}
 
 
@@ -408,9 +408,9 @@ export default class TreeWalker {
 
 
 /**
 /**
  * Type of the step made by {@link engine.view.TreeWalker}.
  * Type of the step made by {@link engine.view.TreeWalker}.
- * Possible values: `'ELEMENT_START'` if walker is at the beginning of a node, `'ELEMENT_END'` if walker is at the end
+ * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end
  * of node, or `'TEXT'` if walker traversed over single and multiple characters.
  * of node, or `'TEXT'` if walker traversed over single and multiple characters.
- * For {@link engine.view.Text} `ELEMENT_START` and `ELEMENT_END` is not returned.
+ * For {@link engine.view.Text} `elementStart` and `elementEnd` is not returned.
  *
  *
  * @typedef {String} engine.view.TreeWalkerValueType
  * @typedef {String} engine.view.TreeWalkerValueType
  */
  */
@@ -422,22 +422,22 @@ export default class TreeWalker {
  * @property {engine.view.TreeWalkerValueType} type
  * @property {engine.view.TreeWalkerValueType} type
  * @property {engine.view.Item} item Item between old and new positions of {@link engine.view.TreeWalker}.
  * @property {engine.view.Item} item Item between old and new positions of {@link engine.view.TreeWalker}.
  * @property {engine.view.Position} previousPosition Previous position of the iterator.
  * @property {engine.view.Position} previousPosition Previous position of the iterator.
- * * Forward iteration: For `'ELEMENT_END'` it is the last position inside the element. For all other types it is the
+ * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  * position before the item. Note that it is more efficient to use this position then calculate the position before
  * position before the item. Note that it is more efficient to use this position then calculate the position before
  * the node using {@link engine.view.Position.createBefore}.
  * the node using {@link engine.view.Position.createBefore}.
- * * Backward iteration: For `'ELEMENT_START'` it is the first position inside the element. For all other types it is
+ * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  * the position after item.
  * the position after item.
  * * If the position is at the beginning or at the end of the {@link engine.view.Text} it is always moved from the
  * * If the position is at the beginning or at the end of the {@link engine.view.Text} it is always moved from the
  * inside of the Text to its parent just before or just after Text.
  * inside of the Text to its parent just before or just after Text.
  * @property {engine.view.Position} nextPosition Next position of the iterator.
  * @property {engine.view.Position} nextPosition Next position of the iterator.
- * * Forward iteration: For `'ELEMENT_START'` it is the first position inside the element. For all other types it is
+ * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  * the position after the item.
  * the position after the item.
- * * Backward iteration: For `'ELEMENT_END'` it is last position inside element. For all other types it is the position
+ * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  * before the item.
  * before the item.
  * * If the position is at the beginning or at the end of the {@link engine.view.Text} it is always moved from the
  * * If the position is at the beginning or at the end of the {@link engine.view.Text} it is always moved from the
  * inside of the Text to its parent just before or just after Text.
  * inside of the Text to its parent just before or just after Text.
- * @property {Number} [length] Length of the item. For `'ELEMENT_START'` it is 1. For `'TEXT'` it is
- * the length of the text. For `'ELEMENT_END'` it is undefined.
+ * @property {Number} [length] Length of the item. For `'elementStart'` it is 1. For `'TEXT'` it is
+ * the length of the text. For `'elementEnd'` it is undefined.
  */
  */
 
 
 /**
 /**

+ 2 - 2
packages/ckeditor5-engine/tests/_utils/model.js

@@ -256,7 +256,7 @@ function writeItem( walkerValue, selection, options ) {
 	const type = walkerValue.type;
 	const type = walkerValue.type;
 	const item = walkerValue.item;
 	const item = walkerValue.item;
 
 
-	if ( type == 'ELEMENT_START' ) {
+	if ( type == 'elementStart' ) {
 		let attrs = writeAttributes( item.getAttributes() );
 		let attrs = writeAttributes( item.getAttributes() );
 
 
 		if ( attrs ) {
 		if ( attrs ) {
@@ -266,7 +266,7 @@ function writeItem( walkerValue, selection, options ) {
 		return `<${ item.name }>`;
 		return `<${ item.name }>`;
 	}
 	}
 
 
-	if ( type == 'ELEMENT_END' ) {
+	if ( type == 'elementEnd' ) {
 		return `</${ item.name }>`;
 		return `</${ item.name }>`;
 	}
 	}
 
 

+ 43 - 43
packages/ckeditor5-engine/tests/model/treewalker.js

@@ -76,15 +76,15 @@ describe( 'TreeWalker', () => {
 
 
 		beforeEach( () => {
 		beforeEach( () => {
 			expected = [
 			expected = [
-				{ type: 'ELEMENT_START', item: img1 },
-				{ type: 'ELEMENT_END', item: img1 },
-				{ type: 'ELEMENT_START', item: paragraph },
+				{ type: 'elementStart', item: img1 },
+				{ type: 'elementEnd', item: img1 },
+				{ type: 'elementStart', item: paragraph },
 				{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 				{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 				{ type: 'TEXT', text: 'r', attrs: [] },
 				{ type: 'TEXT', text: 'r', attrs: [] },
-				{ type: 'ELEMENT_START', item: img2 },
-				{ type: 'ELEMENT_END', item: img2 },
+				{ type: 'elementStart', item: img2 },
+				{ type: 'elementEnd', item: img2 },
 				{ type: 'TEXT', text: 'x', attrs: [] },
 				{ type: 'TEXT', text: 'x', attrs: [] },
-				{ type: 'ELEMENT_END', item: paragraph }
+				{ type: 'elementEnd', item: paragraph }
 			];
 			];
 		} );
 		} );
 
 
@@ -137,8 +137,8 @@ describe( 'TreeWalker', () => {
 
 
 		it( 'should start iterating at the startPosition witch is not a root bound, going backward', () => {
 		it( 'should start iterating at the startPosition witch is not a root bound, going backward', () => {
 			let expected = [
 			let expected = [
-				{ type: 'ELEMENT_START', item: img1 },
-				{ type: 'ELEMENT_END', item: img1 }
+				{ type: 'elementStart', item: img1 },
+				{ type: 'elementEnd', item: img1 }
 			];
 			];
 
 
 			let iterator = new TreeWalker( { startPosition: new Position( root, [ 1 ] ), direction: 'BACKWARD' } );
 			let iterator = new TreeWalker( { startPosition: new Position( root, [ 1 ] ), direction: 'BACKWARD' } );
@@ -158,11 +158,11 @@ describe( 'TreeWalker', () => {
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
-					{ type: 'ELEMENT_START', item: paragraph },
+					{ type: 'elementStart', item: paragraph },
 					{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
-					{ type: 'ELEMENT_END', item: img2 }
+					{ type: 'elementStart', item: img2 },
+					{ type: 'elementEnd', item: img2 }
 				];
 				];
 
 
 				range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 4 ] ) );
 				range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 4 ] ) );
@@ -199,8 +199,8 @@ describe( 'TreeWalker', () => {
 				expected = [
 				expected = [
 					{ type: 'TEXT', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
-					{ type: 'ELEMENT_END', item: img2 }
+					{ type: 'elementStart', item: img2 },
+					{ type: 'elementEnd', item: img2 }
 				];
 				];
 
 
 				range = new Range( new Position( root, [ 1, 1 ] ), new Position( root, [ 1, 4 ] ) );
 				range = new Range( new Position( root, [ 1, 1 ] ), new Position( root, [ 1, 4 ] ) );
@@ -238,9 +238,9 @@ describe( 'TreeWalker', () => {
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
-					{ type: 'ELEMENT_START', item: img1 },
-					{ type: 'ELEMENT_END', item: img1 },
-					{ type: 'ELEMENT_START', item: paragraph },
+					{ type: 'elementStart', item: img1 },
+					{ type: 'elementEnd', item: img1 },
+					{ type: 'elementStart', item: paragraph },
 					{ type: 'TEXT', text: 'b', attrs: [ [ 'bold', true ] ] }
 					{ type: 'TEXT', text: 'b', attrs: [ [ 'bold', true ] ] }
 				];
 				];
 
 
@@ -279,8 +279,8 @@ describe( 'TreeWalker', () => {
 			it( 'should iterating from the start position', () => {
 			it( 'should iterating from the start position', () => {
 				let expected = [
 				let expected = [
 					{ type: 'TEXT', text: 'r', attrs: [] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
-					{ type: 'ELEMENT_END', item: img2 }
+					{ type: 'elementStart', item: img2 },
+					{ type: 'elementEnd', item: img2 }
 				];
 				];
 
 
 				let range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 4 ] ) );
 				let range = new Range( new Position( root, [ 1 ] ), new Position( root, [ 1, 4 ] ) );
@@ -302,8 +302,8 @@ describe( 'TreeWalker', () => {
 			it( 'should iterating from the start position going backward', () => {
 			it( 'should iterating from the start position going backward', () => {
 				let expected = [
 				let expected = [
 					{ type: 'TEXT', text: 'r', attrs: [] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
-					{ type: 'ELEMENT_END', item: img2 }
+					{ type: 'elementStart', item: img2 },
+					{ type: 'elementEnd', item: img2 }
 				];
 				];
 
 
 				let range = new Range( new Position( root, [ 1, 2 ] ), new Position( root, [ 1, 6 ] ) );
 				let range = new Range( new Position( root, [ 1, 2 ] ), new Position( root, [ 1, 6 ] ) );
@@ -330,16 +330,16 @@ describe( 'TreeWalker', () => {
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
-					{ type: 'ELEMENT_START', item: img1 },
-					{ type: 'ELEMENT_END', item: img1 },
-					{ type: 'ELEMENT_START', item: paragraph },
+					{ type: 'elementStart', item: img1 },
+					{ type: 'elementEnd', item: img1 },
+					{ type: 'elementStart', item: paragraph },
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
-					{ type: 'ELEMENT_END', item: img2 },
+					{ type: 'elementStart', item: img2 },
+					{ type: 'elementEnd', item: img2 },
 					{ type: 'CHARACTER', text: 'x', attrs: [] },
 					{ type: 'CHARACTER', text: 'x', attrs: [] },
-					{ type: 'ELEMENT_END', item: paragraph }
+					{ type: 'elementEnd', item: paragraph }
 				];
 				];
 			} );
 			} );
 
 
@@ -379,7 +379,7 @@ describe( 'TreeWalker', () => {
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 }
+					{ type: 'elementStart', item: img2 }
 				];
 				];
 
 
 				start = new Position( root, [ 1, 0 ] ); // p, 0
 				start = new Position( root, [ 1, 0 ] ); // p, 0
@@ -417,13 +417,13 @@ describe( 'TreeWalker', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( 'iterate omitting child nodes and ELEMENT_END `shallow`', () => {
+	describe( 'iterate omitting child nodes and elementEnd `shallow`', () => {
 		let expected;
 		let expected;
 
 
 		before( () => {
 		before( () => {
 			expected = [
 			expected = [
-				{ type: 'ELEMENT_START', item: img1 },
-				{ type: 'ELEMENT_START', item: paragraph }
+				{ type: 'elementStart', item: img1 },
+				{ type: 'elementStart', item: paragraph }
 			];
 			];
 		} );
 		} );
 
 
@@ -451,22 +451,22 @@ describe( 'TreeWalker', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( 'iterate omitting ELEMENT_END `ignoreElementEnd`', () => {
+	describe( 'iterate omitting elementEnd `ignoreElementEnd`', () => {
 		describe( 'merged text', () => {
 		describe( 'merged text', () => {
 			let expected;
 			let expected;
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
-					{ type: 'ELEMENT_START', item: img1 },
-					{ type: 'ELEMENT_START', item: paragraph },
+					{ type: 'elementStart', item: img1 },
+					{ type: 'elementStart', item: paragraph },
 					{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'ba', attrs: [ [ 'bold', true ] ] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
 					{ type: 'TEXT', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
+					{ type: 'elementStart', item: img2 },
 					{ type: 'TEXT', text: 'x', attrs: [] }
 					{ type: 'TEXT', text: 'x', attrs: [] }
 				];
 				];
 			} );
 			} );
 
 
-			it( 'should iterate ignoring ELEMENT_END', () => {
+			it( 'should iterate ignoring elementEnd', () => {
 				let iterator = new TreeWalker( { startPosition: rootBeginning, ignoreElementEnd: true } );
 				let iterator = new TreeWalker( { startPosition: rootBeginning, ignoreElementEnd: true } );
 				let i = 0;
 				let i = 0;
 
 
@@ -478,7 +478,7 @@ describe( 'TreeWalker', () => {
 				expect( i ).to.equal( expected.length );
 				expect( i ).to.equal( expected.length );
 			} );
 			} );
 
 
-			it( 'should iterate ignoring ELEMENT_END going backward', () => {
+			it( 'should iterate ignoring elementEnd going backward', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootEnding,
 					startPosition: rootEnding,
 					ignoreElementEnd: true,
 					ignoreElementEnd: true,
@@ -499,17 +499,17 @@ describe( 'TreeWalker', () => {
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
-					{ type: 'ELEMENT_START', item: img1 },
-					{ type: 'ELEMENT_START', item: paragraph },
+					{ type: 'elementStart', item: img1 },
+					{ type: 'elementStart', item: paragraph },
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'b', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'a', attrs: [ [ 'bold', true ] ] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
 					{ type: 'CHARACTER', text: 'r', attrs: [] },
-					{ type: 'ELEMENT_START', item: img2 },
+					{ type: 'elementStart', item: img2 },
 					{ type: 'CHARACTER', text: 'x', attrs: [] }
 					{ type: 'CHARACTER', text: 'x', attrs: [] }
 				];
 				];
 			} );
 			} );
 
 
-			it( 'should return single characters ignoring ELEMENT_END', () => {
+			it( 'should return single characters ignoring elementEnd', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootBeginning,
 					startPosition: rootBeginning,
 					singleCharacters: true,
 					singleCharacters: true,
@@ -525,7 +525,7 @@ describe( 'TreeWalker', () => {
 				expect( i ).to.equal( expected.length );
 				expect( i ).to.equal( expected.length );
 			} );
 			} );
 
 
-			it( 'should return single characters ignoring ELEMENT_END going backward', () => {
+			it( 'should return single characters ignoring elementEnd going backward', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootEnding,
 					startPosition: rootEnding,
 					singleCharacters: true,
 					singleCharacters: true,
@@ -551,9 +551,9 @@ function expectValue( value, expected, options ) {
 		expectText( value, expected, options );
 		expectText( value, expected, options );
 	} else if ( value.type == 'CHARACTER' ) {
 	} else if ( value.type == 'CHARACTER' ) {
 		expectCharacter( value, expected, options );
 		expectCharacter( value, expected, options );
-	} else if ( value.type == 'ELEMENT_START' ) {
+	} else if ( value.type == 'elementStart' ) {
 		expectStart( value, expected, options );
 		expectStart( value, expected, options );
-	} else if ( value.type == 'ELEMENT_END' ) {
+	} else if ( value.type == 'elementEnd' ) {
 		expectEnd( value, expected, options );
 		expectEnd( value, expected, options );
 	}
 	}
 }
 }

+ 53 - 53
packages/ckeditor5-engine/tests/view/treewalker.js

@@ -82,25 +82,25 @@ describe( 'TreeWalker', () => {
 		beforeEach( () => {
 		beforeEach( () => {
 			expected = [
 			expected = [
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: img1,
 					item: img1,
 					previousPosition: new Position( root, 0 ),
 					previousPosition: new Position( root, 0 ),
 					nextPosition: new Position( img1, 0 )
 					nextPosition: new Position( img1, 0 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_END',
+					type: 'elementEnd',
 					item: img1,
 					item: img1,
 					previousPosition: new Position( img1, 0 ),
 					previousPosition: new Position( img1, 0 ),
 					nextPosition: new Position( root, 1 )
 					nextPosition: new Position( root, 1 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: paragraph,
 					item: paragraph,
 					previousPosition: new Position( root, 1 ),
 					previousPosition: new Position( root, 1 ),
 					nextPosition: new Position( paragraph, 0 )
 					nextPosition: new Position( paragraph, 0 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: bold,
 					item: bold,
 					previousPosition: new Position( paragraph, 0 ),
 					previousPosition: new Position( paragraph, 0 ),
 					nextPosition: new Position( bold, 0 )
 					nextPosition: new Position( bold, 0 )
@@ -112,7 +112,7 @@ describe( 'TreeWalker', () => {
 					nextPosition: new Position( bold, 1 )
 					nextPosition: new Position( bold, 1 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_END',
+					type: 'elementEnd',
 					item: bold,
 					item: bold,
 					previousPosition: new Position( bold, 1 ),
 					previousPosition: new Position( bold, 1 ),
 					nextPosition: new Position( paragraph, 1 )
 					nextPosition: new Position( paragraph, 1 )
@@ -124,13 +124,13 @@ describe( 'TreeWalker', () => {
 					nextPosition: new Position( paragraph, 2 )
 					nextPosition: new Position( paragraph, 2 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: img2,
 					item: img2,
 					previousPosition: new Position( paragraph, 2 ),
 					previousPosition: new Position( paragraph, 2 ),
 					nextPosition: new Position( img2, 0 )
 					nextPosition: new Position( img2, 0 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_END',
+					type: 'elementEnd',
 					item: img2,
 					item: img2,
 					previousPosition: new Position( img2, 0 ),
 					previousPosition: new Position( img2, 0 ),
 					nextPosition: new Position( paragraph, 3 )
 					nextPosition: new Position( paragraph, 3 )
@@ -142,7 +142,7 @@ describe( 'TreeWalker', () => {
 					nextPosition: new Position( paragraph, 4 )
 					nextPosition: new Position( paragraph, 4 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_END',
+					type: 'elementEnd',
 					item: paragraph,
 					item: paragraph,
 					previousPosition: new Position( paragraph, 4 ),
 					previousPosition: new Position( paragraph, 4 ),
 					nextPosition: new Position( root, 2 )
 					nextPosition: new Position( root, 2 )
@@ -197,13 +197,13 @@ describe( 'TreeWalker', () => {
 		it( 'should start iterating at the startPosition witch is not a root bound, going backward', () => {
 		it( 'should start iterating at the startPosition witch is not a root bound, going backward', () => {
 			let expected = [
 			let expected = [
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: img1,
 					item: img1,
 					previousPosition: new Position( root, 0 ),
 					previousPosition: new Position( root, 0 ),
 					nextPosition: new Position( img1, 0 )
 					nextPosition: new Position( img1, 0 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_END',
+					type: 'elementEnd',
 					item: img1,
 					item: img1,
 					previousPosition: new Position( img1, 0 ),
 					previousPosition: new Position( img1, 0 ),
 					nextPosition: new Position( root, 1 )
 					nextPosition: new Position( root, 1 )
@@ -228,13 +228,13 @@ describe( 'TreeWalker', () => {
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( root, 1 ),
 						previousPosition: new Position( root, 1 ),
 						nextPosition: new Position( paragraph, 0 )
 						nextPosition: new Position( paragraph, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( paragraph, 0 ),
 						previousPosition: new Position( paragraph, 0 ),
 						nextPosition: new Position( bold, 0 )
 						nextPosition: new Position( bold, 0 )
@@ -246,7 +246,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( bold, 1 )
 						nextPosition: new Position( bold, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( bold, 1 ),
 						previousPosition: new Position( bold, 1 ),
 						nextPosition: new Position( paragraph, 1 )
 						nextPosition: new Position( paragraph, 1 )
@@ -258,13 +258,13 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( img2, 0 ),
 						previousPosition: new Position( img2, 0 ),
 						nextPosition: new Position( paragraph, 3 )
 						nextPosition: new Position( paragraph, 3 )
@@ -309,7 +309,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( bold, 1 )
 						nextPosition: new Position( bold, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( bold, 1 ),
 						previousPosition: new Position( bold, 1 ),
 						nextPosition: new Position( paragraph, 1 )
 						nextPosition: new Position( paragraph, 1 )
@@ -321,13 +321,13 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( img2, 0 ),
 						previousPosition: new Position( img2, 0 ),
 						nextPosition: new Position( paragraph, 3 )
 						nextPosition: new Position( paragraph, 3 )
@@ -370,25 +370,25 @@ describe( 'TreeWalker', () => {
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( root, 0 ),
 						previousPosition: new Position( root, 0 ),
 						nextPosition: new Position( img1, 0 )
 						nextPosition: new Position( img1, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( img1, 0 ),
 						previousPosition: new Position( img1, 0 ),
 						nextPosition: new Position( root, 1 )
 						nextPosition: new Position( root, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( root, 1 ),
 						previousPosition: new Position( root, 1 ),
 						nextPosition: new Position( paragraph, 0 )
 						nextPosition: new Position( paragraph, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( paragraph, 0 ),
 						previousPosition: new Position( paragraph, 0 ),
 						nextPosition: new Position( bold, 0 )
 						nextPosition: new Position( bold, 0 )
@@ -486,13 +486,13 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( img2, 0 ),
 						previousPosition: new Position( img2, 0 ),
 						nextPosition: new Position( paragraph, 3 )
 						nextPosition: new Position( paragraph, 3 )
@@ -523,7 +523,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( bold, 1 )
 						nextPosition: new Position( bold, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( bold, 1 ),
 						previousPosition: new Position( bold, 1 ),
 						nextPosition: new Position( paragraph, 1 )
 						nextPosition: new Position( paragraph, 1 )
@@ -561,25 +561,25 @@ describe( 'TreeWalker', () => {
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( root, 0 ),
 						previousPosition: new Position( root, 0 ),
 						nextPosition: new Position( img1, 0 )
 						nextPosition: new Position( img1, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( img1, 0 ),
 						previousPosition: new Position( img1, 0 ),
 						nextPosition: new Position( root, 1 )
 						nextPosition: new Position( root, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( root, 1 ),
 						previousPosition: new Position( root, 1 ),
 						nextPosition: new Position( paragraph, 0 )
 						nextPosition: new Position( paragraph, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( paragraph, 0 ),
 						previousPosition: new Position( paragraph, 0 ),
 						nextPosition: new Position( bold, 0 )
 						nextPosition: new Position( bold, 0 )
@@ -609,7 +609,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( bold, 1 )
 						nextPosition: new Position( bold, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( bold, 1 ),
 						previousPosition: new Position( bold, 1 ),
 						nextPosition: new Position( paragraph, 1 )
 						nextPosition: new Position( paragraph, 1 )
@@ -621,13 +621,13 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( img2, 0 ),
 						previousPosition: new Position( img2, 0 ),
 						nextPosition: new Position( paragraph, 3 )
 						nextPosition: new Position( paragraph, 3 )
@@ -639,7 +639,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 4 )
 						nextPosition: new Position( paragraph, 4 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( paragraph, 4 ),
 						previousPosition: new Position( paragraph, 4 ),
 						nextPosition: new Position( root, 2 )
 						nextPosition: new Position( root, 2 )
@@ -704,7 +704,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( bold, 1 )
 						nextPosition: new Position( bold, 1 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_END',
+						type: 'elementEnd',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( bold, 1 ),
 						previousPosition: new Position( bold, 1 ),
 						nextPosition: new Position( paragraph, 1 )
 						nextPosition: new Position( paragraph, 1 )
@@ -716,7 +716,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
@@ -754,19 +754,19 @@ describe( 'TreeWalker', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( 'iterate omitting child nodes and ELEMENT_END `shallow`', () => {
+	describe( 'iterate omitting child nodes and elementEnd `shallow`', () => {
 		let expected;
 		let expected;
 
 
 		before( () => {
 		before( () => {
 			expected = [
 			expected = [
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: img1,
 					item: img1,
 					previousPosition: new Position( root, 0 ),
 					previousPosition: new Position( root, 0 ),
 					nextPosition: new Position( root, 1 )
 					nextPosition: new Position( root, 1 )
 				},
 				},
 				{
 				{
-					type: 'ELEMENT_START',
+					type: 'elementStart',
 					item: paragraph,
 					item: paragraph,
 					previousPosition: new Position( root, 1 ),
 					previousPosition: new Position( root, 1 ),
 					nextPosition: new Position( root, 2 )
 					nextPosition: new Position( root, 2 )
@@ -797,26 +797,26 @@ describe( 'TreeWalker', () => {
 		} );
 		} );
 	} );
 	} );
 
 
-	describe( 'iterate omitting ELEMENT_END `ignoreElementEnd`', () => {
+	describe( 'iterate omitting elementEnd `ignoreElementEnd`', () => {
 		describe( 'merged text', () => {
 		describe( 'merged text', () => {
 			let expected;
 			let expected;
 
 
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( root, 0 ),
 						previousPosition: new Position( root, 0 ),
 						nextPosition: new Position( img1, 0 )
 						nextPosition: new Position( img1, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( root, 1 ),
 						previousPosition: new Position( root, 1 ),
 						nextPosition: new Position( paragraph, 0 )
 						nextPosition: new Position( paragraph, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( paragraph, 0 ),
 						previousPosition: new Position( paragraph, 0 ),
 						nextPosition: new Position( bold, 0 )
 						nextPosition: new Position( bold, 0 )
@@ -834,7 +834,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
@@ -848,7 +848,7 @@ describe( 'TreeWalker', () => {
 				];
 				];
 			} );
 			} );
 
 
-			it( 'should iterate ignoring ELEMENT_END', () => {
+			it( 'should iterate ignoring elementEnd', () => {
 				let iterator = new TreeWalker( { startPosition: rootBeginning, ignoreElementEnd: true } );
 				let iterator = new TreeWalker( { startPosition: rootBeginning, ignoreElementEnd: true } );
 				let i = 0;
 				let i = 0;
 
 
@@ -859,7 +859,7 @@ describe( 'TreeWalker', () => {
 				expect( i ).to.equal( expected.length );
 				expect( i ).to.equal( expected.length );
 			} );
 			} );
 
 
-			it( 'should iterate ignoring ELEMENT_END going backward', () => {
+			it( 'should iterate ignoring elementEnd going backward', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootEnding,
 					startPosition: rootEnding,
 					ignoreElementEnd: true,
 					ignoreElementEnd: true,
@@ -881,19 +881,19 @@ describe( 'TreeWalker', () => {
 			before( () => {
 			before( () => {
 				expected = [
 				expected = [
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img1,
 						item: img1,
 						previousPosition: new Position( root, 0 ),
 						previousPosition: new Position( root, 0 ),
 						nextPosition: new Position( img1, 0 )
 						nextPosition: new Position( img1, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: paragraph,
 						item: paragraph,
 						previousPosition: new Position( root, 1 ),
 						previousPosition: new Position( root, 1 ),
 						nextPosition: new Position( paragraph, 0 )
 						nextPosition: new Position( paragraph, 0 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: bold,
 						item: bold,
 						previousPosition: new Position( paragraph, 0 ),
 						previousPosition: new Position( paragraph, 0 ),
 						nextPosition: new Position( bold, 0 )
 						nextPosition: new Position( bold, 0 )
@@ -929,7 +929,7 @@ describe( 'TreeWalker', () => {
 						nextPosition: new Position( paragraph, 2 )
 						nextPosition: new Position( paragraph, 2 )
 					},
 					},
 					{
 					{
-						type: 'ELEMENT_START',
+						type: 'elementStart',
 						item: img2,
 						item: img2,
 						previousPosition: new Position( paragraph, 2 ),
 						previousPosition: new Position( paragraph, 2 ),
 						nextPosition: new Position( img2, 0 )
 						nextPosition: new Position( img2, 0 )
@@ -943,7 +943,7 @@ describe( 'TreeWalker', () => {
 				];
 				];
 			} );
 			} );
 
 
-			it( 'should return single characters ignoring ELEMENT_END', () => {
+			it( 'should return single characters ignoring elementEnd', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootBeginning,
 					startPosition: rootBeginning,
 					singleCharacters: true,
 					singleCharacters: true,
@@ -958,7 +958,7 @@ describe( 'TreeWalker', () => {
 				expect( i ).to.equal( expected.length );
 				expect( i ).to.equal( expected.length );
 			} );
 			} );
 
 
-			it( 'should return single characters ignoring ELEMENT_END going backward', () => {
+			it( 'should return single characters ignoring elementEnd going backward', () => {
 				let iterator = new TreeWalker( {
 				let iterator = new TreeWalker( {
 					startPosition: rootEnding,
 					startPosition: rootEnding,
 					singleCharacters: true,
 					singleCharacters: true,
@@ -994,9 +994,9 @@ function expectValue( value, expected, options = {} ) {
 
 
 	if ( value.type == 'TEXT' ) {
 	if ( value.type == 'TEXT' ) {
 		expectText( value, expected );
 		expectText( value, expected );
-	} else if ( value.type == 'ELEMENT_START' ) {
+	} else if ( value.type == 'elementStart' ) {
 		expectStart( value, expected );
 		expectStart( value, expected );
-	} else if ( value.type == 'ELEMENT_END' ) {
+	} else if ( value.type == 'elementEnd' ) {
 		expectEnd( value, expected );
 		expectEnd( value, expected );
 	}
 	}
 }
 }