Index: trunk/parsers/wikidom/lib/hype/bases/es.DocumentModelNode.js |
— | — | @@ -30,6 +30,12 @@ |
31 | 31 | node.contentLength = contents; |
32 | 32 | } else { |
33 | 33 | node.contentLength = 0; |
| 34 | + // If contents was an array, some items were added, which we need to account for |
| 35 | + if ( this.length ) { |
| 36 | + for ( var i = 0; i < this.length; i++ ) { |
| 37 | + node.contentLength += this[i].getElementLength(); |
| 38 | + } |
| 39 | + } |
34 | 40 | } |
35 | 41 | |
36 | 42 | return node; |
— | — | @@ -124,13 +130,3 @@ |
125 | 131 | es.DocumentModelNode.prototype.getElementLength = function() { |
126 | 132 | return this.contentLength + 2; |
127 | 133 | }; |
128 | | - |
129 | | -/** |
130 | | - * Checks if this node has child nodes. |
131 | | - * |
132 | | - * @method |
133 | | - * @returns {Boolean} Whether the node has any children |
134 | | - */ |
135 | | -es.DocumentModelNode.prototype.hasChildren = function() { |
136 | | - return !!this.length; |
137 | | -}; |
Index: trunk/parsers/wikidom/lib/hype/bases/es.ModelNode.js |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | * @method |
202 | 202 | * @returns {es.DocumentModelNode} Root node |
203 | 203 | */ |
204 | | -es.DocumentModelNode.prototype.getRoot = function() { |
| 204 | +es.ModelNode.prototype.getRoot = function() { |
205 | 205 | return this.root; |
206 | 206 | }; |
207 | 207 | |