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

100% Statements 9/9
100% Branches 0/0
100% Functions 3/3
100% Lines 9/9

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   34x   34x 34x         1x       1x 10x     1x 2x    
/*!
 * VisualEditor DataModel DocumentSlice class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * 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} [originalRange] Range of original data
 * @param {ve.Range} [balancedRange] Range of balanced data
 * @param {ve.dm.Document} [originalDocument]
 */
ve.dm.DocumentSlice = function VeDmDocumentSlice( data, htmlDocument, parentDocument, internalList, originalRange, balancedRange, originalDocument ) {
	// Parent constructor
	ve.dm.DocumentSlice.super.call( this, data, htmlDocument, parentDocument, internalList, undefined, undefined, undefined, originalDocument );
 
	this.originalRange = originalRange;
	this.balancedRange = balancedRange;
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.DocumentSlice, ve.dm.Document );
 
/* Methods */
 
ve.dm.DocumentSlice.prototype.getOriginalData = function () {
	return this.getData( this.originalRange );
};
 
ve.dm.DocumentSlice.prototype.getBalancedData = function () {
	return this.getData( this.balancedRange );
};