Ticket #5568: 5568.patch
File 5568.patch, 3.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/selection/plugin.js
1009 1009 { 1010 1010 var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true ); 1011 1011 var fillerTextRegex = /\ufeff|\u00a0/; 1012 var nonCells = { table:1,tbody:1,tr:1 }; 1012 1013 1013 1014 CKEDITOR.dom.range.prototype.select = 1014 1015 CKEDITOR.env.ie ? … … 1019 1020 var isStartMarkerAlone; 1020 1021 var dummySpan; 1021 1022 1023 // IE doesn't support selecting the entire table row/cell, move the selection into cells, e.g. 1024 // <table><tbody><tr>[<td>cell</b></td>... => <table><tbody><tr><td>[cell</td>... 1025 if ( this.startContainer.type == CKEDITOR.NODE_ELEMENT && this.startContainer.getName() in nonCells 1026 || this.endContainer.type == CKEDITOR.NODE_ELEMENT && this.endContainer.getName() in nonCells ) 1027 { 1028 this.shrink( CKEDITOR.NODE_ELEMENT, true ); 1029 } 1030 1022 1031 var bookmark = this.createBookmark(); 1023 1032 1024 1033 // Create marker tags for the start and end boundaries. -
_source/core/dom/range.js
1240 1240 * always anchor beside text nodes or innermost element. 1241 1241 * @param {Number} mode ( CKEDITOR.SHRINK_ELEMENT | CKEDITOR.SHRINK_TEXT ) The shrinking mode. 1242 1242 */ 1243 shrink : function( mode )1243 shrink : function( mode, selectContents ) 1244 1244 { 1245 1245 // Unable to shrink a collapsed range. 1246 1246 if ( !this.collapsed ) … … 1315 1315 if ( moveStart ) 1316 1316 { 1317 1317 var textStart = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastForward' : 'next'](); 1318 textStart && this.setStart Before( textStart);1318 textStart && this.setStartAt( textStart, selectContents ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START ); 1319 1319 } 1320 1320 1321 1321 if ( moveEnd ) 1322 1322 { 1323 1323 walker.reset(); 1324 1324 var textEnd = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastBackward' : 'previous'](); 1325 textEnd && this.setEndA fter( textEnd);1325 textEnd && this.setEndAt( textEnd, selectContents ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END ); 1326 1326 } 1327 1327 1328 1328 return !!( moveStart || moveEnd ); … … 1382 1382 // we will not need this check for our use of this class so we can 1383 1383 // ignore it for now. 1384 1384 1385 // Fixing invalid range start inside dtd empty elements. 1386 if( startNode.type == CKEDITOR.NODE_ELEMENT 1387 && CKEDITOR.dtd.$empty[ startNode.getName() ] ) 1388 startNode = startNode.getParent(), startOffset = startNode.getIndex(); 1389 1385 1390 this.startContainer = startNode; 1386 1391 this.startOffset = startOffset; 1387 1392 … … 1408 1413 // will not need this check for our use of this class so we can ignore 1409 1414 // it for now. 1410 1415 1416 // Fixing invalid range end inside dtd empty elements. 1417 if( endNode.type == CKEDITOR.NODE_ELEMENT 1418 && CKEDITOR.dtd.$empty[ endNode.getName() ] ) 1419 endNode = endNode.getParent(), endOffset = endNode.getIndex() + 1; 1420 1411 1421 this.endContainer = endNode; 1412 1422 this.endOffset = endOffset; 1413 1423