mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
042ffb4e3b
* Added converters to all relevant node implementations * Added new annotation objects with their own factory Change-Id: I9870d6d5eac45083929d74d2e58917d0939ca917
34 lines
695 B
JavaScript
34 lines
695 B
JavaScript
module( 've.dm.LeafNode' );
|
|
|
|
/* Stubs */
|
|
|
|
ve.dm.LeafNodeStub = function() {
|
|
// Inheritance
|
|
ve.dm.LeafNode.call( this, 'leaf-stub' );
|
|
};
|
|
|
|
ve.dm.LeafNodeStub.rules = {
|
|
'isWrapped': true,
|
|
'isContent': true,
|
|
'canContainContent': false,
|
|
'childNodeTypes': []
|
|
};
|
|
|
|
ve.dm.LeafNodeStub.converters = null;
|
|
|
|
ve.extendClass( ve.dm.LeafNodeStub, ve.dm.LeafNode );
|
|
|
|
ve.dm.nodeFactory.register( 'leaf-stub', ve.dm.LeafNodeStub );
|
|
|
|
/* Tests */
|
|
|
|
test( 'canHaveChildren', 1, function() {
|
|
var node = new ve.dm.LeafNodeStub();
|
|
equal( node.canHaveChildren(), false );
|
|
} );
|
|
|
|
test( 'canHaveGrandchildren', 1, function() {
|
|
var node = new ve.dm.LeafNodeStub();
|
|
equal( node.canHaveGrandchildren(), false );
|
|
} );
|