All files / src/dm/nodes ve.dm.TextNode.js

100% Statements 13/13
100% Branches 2/2
100% Functions 3/3
100% Lines 13/13

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 43 44 45 46 47 48 49 50 51                              1x   5754x     5754x         1x       1x   1x   1x   1x       1x 5827x     1x 5827x         1x  
/*!
 * VisualEditor DataModel TextNode class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * DataModel text node.
 *
 * @class
 * @extends ve.dm.LeafNode
 *
 * @constructor
 * @param {number} [length=0] Length of content data in document
 */
ve.dm.TextNode = function VeDmTextNode( length ) {
	// Parent constructor
	ve.dm.TextNode.super.call( this );
 
	// TODO: length is only set on construction in tests
	this.length = length || 0;
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.TextNode, ve.dm.LeafNode );
 
/* Static Properties */
 
ve.dm.TextNode.static.name = 'text';
 
ve.dm.TextNode.static.isWrapped = false;
 
ve.dm.TextNode.static.isContent = true;
 
ve.dm.TextNode.static.matchTagNames = [];
 
/* Methods */
 
ve.dm.TextNode.prototype.canHaveSlugBefore = function () {
	return false;
};
 
ve.dm.TextNode.prototype.canHaveSlugAfter = function () {
	return false;
};
 
/* Registration */
 
ve.dm.modelRegistry.register( ve.dm.TextNode );