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

90.9% Statements 10/11
100% Branches 0/0
50% Functions 1/2
90.9% Lines 10/11

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 52                              1x   2593x     2593x         1x       1x   1x   1x   1x       1x                     1x  
/*!
 * VisualEditor DataModel DocumentNode class.
 *
 * @copyright See AUTHORS.txt
 */
 
/**
 * DataModel document node.
 *
 * @class
 * @extends ve.dm.BranchNode
 *
 * @constructor
 * @param {ve.dm.BranchNode[]} [children] Child nodes to attach
 */
ve.dm.DocumentNode = function VeDmDocumentNode( children ) {
	// Parent constructor
	ve.dm.DocumentNode.super.call( this, null, children );
 
	// Properties
	this.root = this;
};
 
/* Inheritance */
 
OO.inheritClass( ve.dm.DocumentNode, ve.dm.BranchNode );
 
/* Static Properties */
 
ve.dm.DocumentNode.static.name = 'document';
 
ve.dm.DocumentNode.static.isWrapped = false;
 
ve.dm.DocumentNode.static.parentNodeTypes = [];
 
ve.dm.DocumentNode.static.matchTagNames = [];
 
/* Methods */
 
ve.dm.DocumentNode.prototype.getElement =
ve.dm.DocumentNode.prototype.getAttribute =
ve.dm.DocumentNode.prototype.getAttributes =
ve.dm.DocumentNode.prototype.getOriginalDomElements =
ve.dm.DocumentNode.prototype.getClonedElement =
ve.dm.DocumentNode.prototype.getHashObject = function () {
	throw new Error( 'DocumentNodes do not exist in the linear model' );
};
 
/* Registration */
 
ve.dm.modelRegistry.register( ve.dm.DocumentNode );