Changeset 7410
- Timestamp:
- 03/23/12 13:57:16 (14 months ago)
- Location:
- CKEditor/trunk
- Files:
-
- 2 edited
-
CHANGES.html (modified) (1 diff)
-
_source/plugins/domiterator/plugin.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/trunk/CHANGES.html
r7409 r7410 76 76 <li><a href="http://dev.ckeditor.com/ticket/7492">#7492</a> : Enable in the Style system to use overrides with the same element (change classes instead of nesting).</li> 77 77 <li><a href="http://dev.ckeditor.com/ticket/6111">#6111</a> : Splitting cells results in incorrect column spans.</li> 78 <li><a href="http://dev.ckeditor.com/ticket/8247">#8247</a> : [IE] Fix error when indent with page breaks inside of contents.</li> 78 79 </ul> 79 80 <h3> -
CKEditor/trunk/_source/plugins/domiterator/plugin.js
r6617 r7410 64 64 65 65 // This is the first iteration. Let's initialize it. 66 if ( !this._. lastNode)66 if ( !this._.started ) 67 67 { 68 68 range = this.range.clone(); … … 77 77 CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS ); 78 78 79 var walker = new CKEDITOR.dom.walker( range ), 80 ignoreBookmarkTextEvaluator = CKEDITOR.dom.walker.bookmark( true, true ); 81 // Avoid anchor inside bookmark inner text. 82 walker.evaluator = ignoreBookmarkTextEvaluator; 83 this._.nextNode = walker.next(); 84 // TODO: It's better to have walker.reset() used here. 85 walker = new CKEDITOR.dom.walker( range ); 86 walker.evaluator = ignoreBookmarkTextEvaluator; 87 var lastNode = walker.previous(); 88 this._.lastNode = lastNode.getNextSourceNode( true ); 89 90 // We may have an empty text node at the end of block due to [3770]. 91 // If that node is the lastNode, it would cause our logic to leak to the 92 // next block.(#3887) 93 if ( this._.lastNode && 94 this._.lastNode.type == CKEDITOR.NODE_TEXT && 95 !CKEDITOR.tools.trim( this._.lastNode.getText() ) && 96 this._.lastNode.getParent().isBlockBoundary() ) 97 { 98 var testRange = new CKEDITOR.dom.range( range.document ); 99 testRange.moveToPosition( this._.lastNode, CKEDITOR.POSITION_AFTER_END ); 100 if ( testRange.checkEndOfBlock() ) 101 { 102 var path = new CKEDITOR.dom.elementPath( testRange.endContainer ); 103 var lastBlock = path.block || path.blockLimit; 104 this._.lastNode = lastBlock.getNextSourceNode( true ); 105 } 106 } 107 108 // Probably the document end is reached, we need a marker node. 109 if ( !this._.lastNode ) 110 { 111 this._.lastNode = this._.docEndMarker = range.document.createText( '' ); 112 this._.lastNode.insertAfter( lastNode ); 113 } 114 115 // Let's reuse this variable. 116 range = null; 79 if ( !range.collapsed ) 80 { 81 var walker = new CKEDITOR.dom.walker( range.clone() ), 82 ignoreBookmarkTextEvaluator = CKEDITOR.dom.walker.bookmark( true, true ); 83 // Avoid anchor inside bookmark inner text. 84 walker.evaluator = ignoreBookmarkTextEvaluator; 85 this._.nextNode = walker.next(); 86 // TODO: It's better to have walker.reset() used here. 87 walker = new CKEDITOR.dom.walker( range.clone() ); 88 walker.evaluator = ignoreBookmarkTextEvaluator; 89 var lastNode = walker.previous(); 90 this._.lastNode = lastNode.getNextSourceNode( true ); 91 92 // We may have an empty text node at the end of block due to [3770]. 93 // If that node is the lastNode, it would cause our logic to leak to the 94 // next block.(#3887) 95 if ( this._.lastNode && 96 this._.lastNode.type == CKEDITOR.NODE_TEXT && 97 !CKEDITOR.tools.trim( this._.lastNode.getText() ) && 98 this._.lastNode.getParent().isBlockBoundary() ) 99 { 100 var testRange = new CKEDITOR.dom.range( range.document ); 101 testRange.moveToPosition( this._.lastNode, CKEDITOR.POSITION_AFTER_END ); 102 if ( testRange.checkEndOfBlock() ) 103 { 104 var path = new CKEDITOR.dom.elementPath( testRange.endContainer ); 105 var lastBlock = path.block || path.blockLimit; 106 this._.lastNode = lastBlock.getNextSourceNode( true ); 107 } 108 } 109 110 // Probably the document end is reached, we need a marker node. 111 if ( !this._.lastNode ) 112 { 113 this._.lastNode = this._.docEndMarker = range.document.createText( '' ); 114 this._.lastNode.insertAfter( lastNode ); 115 } 116 117 // Let's reuse this variable. 118 range = null; 119 } 120 121 this._.started = 1; 117 122 } 118 123 … … 280 285 281 286 removePreviousBr = removeLastBr = true; 282 }287 } 283 288 else if ( block.getName() != 'li' ) 284 289 { … … 347 352 if ( !this._.nextNode ) 348 353 { 349 this._.nextNode = ( isLast || block.equals( lastNode ) ) ? null :354 this._.nextNode = ( isLast || block.equals( lastNode ) || !lastNode ) ? null : 350 355 getNextSourceNode( block, 1, lastNode ); 351 356 }
Note: See TracChangeset
for help on using the changeset viewer.
