Index: trunk/extensions/VisualEditor/tests/es/es.DocumentBranchNode.test.js |
— | — | @@ -167,7 +167,7 @@ |
168 | 168 | { |
169 | 169 | 'node': root2, |
170 | 170 | 'input': new es.Range( 0, 0 ), |
171 | | - 'output': [], |
| 171 | + 'output': [{ 'node': root2, 'range': new es.Range( 0, 0 ), 'globalRange': new es.Range( 0, 0 ) }], |
172 | 172 | 'desc': 'Zero-length range before the beginning of a node' |
173 | 173 | }, |
174 | 174 | // Test 2 |
— | — | @@ -272,14 +272,14 @@ |
273 | 273 | { |
274 | 274 | 'node': root2, |
275 | 275 | 'input': new es.Range( 30, 30 ), |
276 | | - 'output': [], |
| 276 | + 'output': [{ 'node': root2, 'range': new es.Range( 30, 30 ), 'globalRange': new es.Range( 30, 30 ) }], |
277 | 277 | 'desc': 'Zero-length range past the end of a node' |
278 | 278 | }, |
279 | 279 | // Test 17 |
280 | 280 | { |
281 | 281 | 'node': root2, |
282 | 282 | 'input': new es.Range( 20, 20 ), |
283 | | - 'output': [], |
| 283 | + 'output': [{ 'node': root2, 'range': new es.Range( 20, 20 ), 'globalRange': new es.Range( 20, 20 ) }], |
284 | 284 | 'desc': 'Zero-length range between two nodes' |
285 | 285 | }, |
286 | 286 | |
Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js |
— | — | @@ -325,7 +325,7 @@ |
326 | 326 | |
327 | 327 | if ( start == end && ( start == left - 1 || start == right + 1 ) ) { |
328 | 328 | // Empty range outside of any node |
329 | | - return []; |
| 329 | + return [{ 'node': this, 'range': new es.Range( start, end ), 'globalRange': new es.Range( start, end ) }]; |
330 | 330 | } |
331 | 331 | |
332 | 332 | startInside = start >= left && start <= right; // is the start inside childNode? |