Kaynağa Gözat

Applied review comments.

Kuba Niegowski 5 yıl önce
ebeveyn
işleme
a4c69f497d

+ 8 - 9
packages/ckeditor5-table/src/tablenavigation.js

@@ -197,17 +197,16 @@ export default class TableNavigation extends Plugin {
 		const selectedCells = getSelectedTableCells( selection );
 
 		if ( selectedCells.length ) {
-			if ( expandSelection ) {
-				const tableSelection = this.editor.plugins.get( 'TableSelection' );
-				const focusCell = tableSelection.getFocusCell();
+			let focusCell = null;
 
-				this._navigateFromCellInDirection( focusCell, direction, expandSelection );
+			if ( expandSelection ) {
+				focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
 			} else {
-				const tableCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
-
-				this._navigateFromCellInDirection( tableCell, direction, expandSelection );
+				focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
 			}
 
+			this._navigateFromCellInDirection( focusCell, direction, expandSelection );
+
 			return true;
 		}
 
@@ -445,9 +444,9 @@ export default class TableNavigation extends Plugin {
 	 * @protected
 	 * @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
 	 * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
-	 * @param {Boolean} expandSelection If the current selection should be expanded.
+	 * @param {Boolean} [expandSelection=false] If the current selection should be expanded.
 	 */
-	_navigateFromCellInDirection( focusCell, direction, expandSelection ) {
+	_navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
 		const model = this.editor.model;
 
 		const table = findAncestor( 'table', focusCell );

+ 53 - 52
packages/ckeditor5-table/src/tableselection.js

@@ -108,6 +108,58 @@ export default class TableSelection extends Plugin {
 	}
 
 	/**
+	 * Sets the model selection based on given anchor and target cells (can be the same cell).
+	 * Takes care of setting the backward flag.
+	 *
+	 * @param {module:engine/model/element~Element} anchorCell
+	 * @param {module:engine/model/element~Element} targetCell
+	 */
+	setCellSelection( anchorCell, targetCell ) {
+		const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
+
+		this.editor.model.change( writer => {
+			writer.setSelection(
+				cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
+				{ backward: cellsToSelect.backward }
+			);
+		} );
+	}
+
+	/**
+	 * Returns the focus cell from the current selection.
+	 *
+	 * @returns {module:engine/model/element~Element}
+	 */
+	getFocusCell() {
+		const selection = this.editor.model.document.selection;
+		const focusCellRange = [ ...selection.getRanges() ].pop();
+		const element = focusCellRange.getContainedElement();
+
+		if ( element && element.is( 'tableCell' ) ) {
+			return element;
+		}
+
+		return null;
+	}
+
+	/**
+	 * Returns the anchor cell from the current selection.
+	 *
+	 * @returns {module:engine/model/element~Element} anchorCell
+	 */
+	getAnchorCell() {
+		const selection = this.editor.model.document.selection;
+		const anchorCellRange = first( selection.getRanges() );
+		const element = anchorCellRange.getContainedElement();
+
+		if ( element && element.is( 'tableCell' ) ) {
+			return element;
+		}
+
+		return null;
+	}
+
+	/**
 	 * Defines a selection converter which marks the selected cells with a specific class.
 	 *
 	 * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
@@ -365,58 +417,6 @@ export default class TableSelection extends Plugin {
 	}
 
 	/**
-	 * Sets the model selection based on given anchor and target cells (can be the same cell).
-	 * Takes care of setting the backward flag.
-	 *
-	 * @param {module:engine/model/element~Element} anchorCell
-	 * @param {module:engine/model/element~Element} targetCell
-	 */
-	setCellSelection( anchorCell, targetCell ) {
-		const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
-
-		this.editor.model.change( writer => {
-			writer.setSelection(
-				cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
-				{ backward: cellsToSelect.backward }
-			);
-		} );
-	}
-
-	/**
-	 * Returns the focus cell from the current selection.
-	 *
-	 * @returns {module:engine/model/element~Element}
-	 */
-	getFocusCell() {
-		const selection = this.editor.model.document.selection;
-		const focusCellRange = [ ...selection.getRanges() ].pop();
-		const element = focusCellRange.getContainedElement();
-
-		if ( element && element.is( 'tableCell' ) ) {
-			return element;
-		}
-
-		return null;
-	}
-
-	/**
-	 * Returns the anchor cell from the current selection.
-	 *
-	 * @returns {module:engine/model/element~Element} anchorCell
-	 */
-	getAnchorCell() {
-		const selection = this.editor.model.document.selection;
-		const anchorCellRange = first( selection.getRanges() );
-		const element = anchorCellRange.getContainedElement();
-
-		if ( element && element.is( 'tableCell' ) ) {
-			return element;
-		}
-
-		return null;
-	}
-
-	/**
 	 * Returns the model table cell element based on the target element of the passed DOM event.
 	 *
 	 * @private
@@ -459,6 +459,7 @@ export default class TableSelection extends Plugin {
 		const startColumn = Math.min( startLocation.column, endLocation.column );
 		const endColumn = Math.max( startLocation.column, endLocation.column );
 
+		// 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
 		const selectionMap = new Array( endRow - startRow + 1 ).fill( null ).map( () => [] );
 
 		for ( const cellInfo of new TableWalker( findAncestor( 'table', anchorCell ), { startRow, endRow } ) ) {

+ 40 - 40
packages/ckeditor5-table/tests/tablenavigation.js

@@ -465,7 +465,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the start position of the cell on the right when the direction is "right"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '[]01', '02' ],
@@ -475,7 +475,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the start position of the cell below when the direction is "down"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -485,7 +485,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should select a whole table when the direction is "up"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>[' + modelTable( [
 							[ '00', '01', '02' ],
@@ -495,7 +495,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should select a whole table when the direction is "left"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>[' + modelTable( [
 							[ '00', '01', '02' ],
@@ -513,7 +513,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position of the cell on the left when the direction is "left"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -523,7 +523,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position of the cell above when the direction is "up"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -533,7 +533,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should select a whole table when the direction is "down"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>[' + modelTable( [
 							[ '00', '01', '02' ],
@@ -543,7 +543,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should select a whole table when the direction is "right"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>[' + modelTable( [
 							[ '00', '01', '02' ],
@@ -561,7 +561,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to start position of the cell on the right when the direction is "right"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -571,7 +571,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position of the cell above when the direction is "up"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00[]', '01', '02' ],
@@ -581,7 +581,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the start position of the cell below when the direction is "down"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -591,7 +591,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position of the last cell in the previous row when the direction is "left"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02[]' ],
@@ -609,7 +609,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position of the cell on the left when the direction is "left"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -619,7 +619,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the end position the cell above when the direction is "up"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02[]' ],
@@ -629,7 +629,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the start position of the cell below when the direction is "down"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -639,7 +639,7 @@ describe( 'TableNavigation', () => {
 					} );
 
 					it( 'should navigate to the start position of the first cell in the next row when the direction is "right"', () => {
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), '<paragraph>foo</paragraph>' + modelTable( [
 							[ '00', '01', '02' ],
@@ -676,7 +676,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-col-spanned cell when approaching from the upper-spanned row', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 0 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -690,7 +690,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-col-spanned cell when approaching from the lower-spanned row', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 2, 0 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -704,7 +704,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell when approaching from the other row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -718,7 +718,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the cell in the upper-spanned row when approaching from the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 2 ] ); // Cell 13.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -732,7 +732,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 0 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -746,7 +746,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate from the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'right', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'right' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -762,7 +762,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell when approaching from the upper-spanned row', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 3 ] ); // Cell 14.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -776,7 +776,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell when approaching from the lower-spanned row', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 2, 1 ] ); // Cell 24.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -790,7 +790,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell when approaching from the other row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 2 ] ); // Cell 13.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -804,7 +804,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the cell in the upper-spanned row when approaching from the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 1 ] ); // Cell 11.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -818,7 +818,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 2 ] ); // Cell 33.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -832,7 +832,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate from the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'left', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'left' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -848,7 +848,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-col-spanned cell when approaching from the first spanned column', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -862,7 +862,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-col-spanned cell when approaching from the last spanned column', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 0, 2 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -876,7 +876,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell when approaching from the other col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -890,7 +890,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the cell in the first spanned column when approaching from the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 1 ] ); // Cell 11.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -904,7 +904,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 0, 3 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -918,7 +918,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate from the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 2 ] ); // Cell 13.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'down', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'down' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -934,7 +934,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the col-spanned cell when approaching from the first spanned column', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 4, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -948,7 +948,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the col-spanned cell when approaching from the last spanned column', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 4, 2 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -962,7 +962,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-col-spanned cell when approaching from the other col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -976,7 +976,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the cell in the first spanned column when approaching from the col-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 1 ] );
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01[]', '02', '03', '04' ],
@@ -990,7 +990,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate to the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 3, 2 ] ); // Cell 33.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03', '04' ],
@@ -1004,7 +1004,7 @@ describe( 'TableNavigation', () => {
 					it( 'should navigate from the row-spanned cell', () => {
 						const tableCell = modelRoot.getNodeByPath( [ 0, 1, 2 ] ); // Cell 13.
 
-						tableNavigation._navigateFromCellInDirection( tableCell, 'up', false );
+						tableNavigation._navigateFromCellInDirection( tableCell, 'up' );
 
 						assertEqualMarkup( getModelData( model ), modelTable( [
 							[ '00', '01', '02', '03[]', '04' ],