Ticket #3367: test_walker_stopAtBody.patch
File test_walker_stopAtBody.patch, 1.5 KB (added by , 15 years ago) |
---|
-
_source/tests/core/dom/walker.html
24 24 var simplifiedNodes = []; 25 25 26 26 for ( var i = 0 ; i < nodes.length ; i++ ) 27 simplifiedNodes.push( nodes[i].type == CKEDITOR.NODE_TEXT ? nodes[i].getText() : ( '<' + nodes[i].getName() + '>' ) ); 27 simplifiedNodes.push( nodes[i].type == CKEDITOR.NODE_TEXT ? 28 nodes[i].getText() : ( 29 nodes[i].getName ? 30 ( '<' + nodes[i].getName() + '>' ) : '#comment' ) ); 28 31 29 32 assert.areSame( wanted.toString(), simplifiedNodes.toString() ); 30 33 } … … 326 329 assertNodesList( [ '<p>', ' test', '<b>', '<i>', 'simple', 'a ', 'This is ' ], nodes ); 327 330 }, 328 331 332 test_stop_at_body: function() 333 { 334 335 var range = new CKEDITOR.dom.range( doc ); 336 range.setStartBefore( doc.getBody().getPrevious() ); 337 range.setEndAfter( doc.getById( 'emptyP' ) ); 338 339 var walker = new CKEDITOR.dom.walker( range ); 340 var nodes = [], 341 node; 342 while ( node = walker.previous() ) 343 { 344 nodes.push( node ); 345 } 346 347 assertNodesList( [ '<p>'], nodes ); 348 }, 349 329 350 name : document.title 330 351 }; 331 352 })() ); 332 353 //window.onload = tc.test_stop_at_body; 333 354 //]]> 334 355 </script> 335 356 </head> 336 <body> 337 <div id="playground"></p> 338 </body> 357 <body><p id="emptyP"></p><p id="playground"></p></body> 339 358 </html> 359 No newline at end of file