All files / src/dm ve.dm.TableSlice.js

100% Statements 7/7
50% Branches 1/2
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                                      1x   2x         1x                 1x 1x 1x   1x    
/*!
 * VisualEditor DataModel TableSlice class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * DataModel document slice
 *
 * @class
 * @extends ve.dm.Document
 * @constructor
 * @param {HTMLDocument|Array|ve.dm.LinearData} data
 * @param {HTMLDocument} [htmlDocument]
 * @param {ve.dm.Document} [parentDocument]
 * @param {ve.dm.InternalList} [internalList]
 * @param {ve.Range} [tableRange] Table range
 * @param {ve.dm.Document} [originalDocument]
 */
ve.dm.TableSlice = function VeDmTableSlice( data, htmlDocument, parentDocument, internalList, tableRange, originalDocument ) {
	// Parent constructor
	ve.dm.TableSlice.super.call( this, data, htmlDocument, parentDocument, internalList, tableRange, tableRange, originalDocument );
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.TableSlice, ve.dm.DocumentSlice );
 
/* Methods */
 
/**
 * Get the parent table node in this document slice
 *
 * @return {ve.dm.TableNode} Table node
 */
ve.dm.TableSlice.prototype.getTableNode = function () {
	Eif ( !this.documentNode.length ) {
		this.rebuildTree();
	}
	return this.documentNode.children[ 0 ];
};