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

42.86% Statements 3/7
0% Branches 0/2
0% Functions 0/2
42.86% Lines 3/7
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                                                                             
/*!
 * VisualEditor DataModel TableSlice class.
 *
 * @copyright 2011-2019 VisualEditor Team and others; see http://ve.mit-license.org
 */
 
/**
 * DataModel document slice
 *
 * @class
 * @extends ve.dm.Document
 * @constructor
 * @param {HTMLDocument|Array|ve.dm.ElementLinearData} 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 () {
	if ( !this.documentNode.length ) {
		this.rebuildTree();
	}
	return this.documentNode.children[ 0 ];
};