Changeset 6391
- Timestamp:
- 01/28/11 17:09:01 (2 years ago)
- Location:
- CKEditor/trunk/_source
- Files:
-
- 3 edited
-
core/dom/range.js (modified) (4 diffs)
-
core/dom/walker.js (modified) (2 diffs)
-
plugins/styles/plugin.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/trunk/_source/core/dom/range.js
r6373 r6391 824 824 }, 825 825 826 enlarge : function( unit ) 826 /** 827 * Expands the range so that partial units are completely contained. 828 * @param unit {Number} The unit type to expand with. 829 * @param {Boolean} [excludeBrs=false] Whether include line-breaks when expanding. 830 */ 831 enlarge : function( unit, excludeBrs ) 827 832 { 828 833 switch ( unit ) … … 945 950 // We need to check for the bookmark attribute because IE insists on 946 951 // rendering the display:none nodes we use for bookmarks. (#3363) 947 if ( sibling.$.offsetWidth > 0 && !sibling.data( 'cke-bookmark' ) ) 952 // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) 953 if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) 948 954 { 949 955 // We'll accept it only if we need … … 1080 1086 endTop = enlargeable; 1081 1087 else if ( enlargeable ) 1082 { 1083 var bogus = enlargeable.isBlockBoundary() && enlargeable.getBogus(); 1084 1085 // Exclude bogus <br /> at the end of block. 1086 if ( bogus ) 1087 this.setEndBefore( bogus ); 1088 else 1089 this.setEndAfter( enlargeable ); 1090 } 1088 this.setEndAfter( enlargeable ); 1091 1089 } 1092 1090 … … 1112 1110 // We need to check for the bookmark attribute because IE insists on 1113 1111 // rendering the display:none nodes we use for bookmarks. (#3363) 1114 if ( sibling.$.offsetWidth > 0 && !sibling.data( 'cke-bookmark' ) ) 1112 // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) 1113 if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) 1115 1114 { 1116 1115 // We'll accept it only if we need -
CKEditor/trunk/_source/core/dom/walker.js
r6382 r6391 437 437 return isBookmark( node ) 438 438 || isWhitespaces( node ) 439 || node.type == CKEDITOR.NODE_ELEMENT && node.getName() in CKEDITOR.dtd.$removeEmpty; 439 || node.type == CKEDITOR.NODE_ELEMENT 440 && node.getName() in CKEDITOR.dtd.$inline 441 && !( node.getName() in CKEDITOR.dtd.$empty ); 440 442 }; 441 443 … … 443 445 CKEDITOR.dom.element.prototype.getBogus = function() 444 446 { 445 // Bogus are not always at the end, e.g. <p>< strong>text<br /></strong></p> (#7070).447 // Bogus are not always at the end, e.g. <p><a>text<br /></a></p> (#7070). 446 448 var tail = this; 447 449 do { tail = tail.getPreviousSourceNode(); } -
CKEditor/trunk/_source/plugins/styles/plugin.js
r6384 r6391 431 431 432 432 // Expand the range. 433 range.enlarge( CKEDITOR.ENLARGE_ELEMENT );433 range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); 434 434 range.trim(); 435 435 … … 658 658 * that our operation logic can be simpler. 659 659 */ 660 range.enlarge( CKEDITOR.ENLARGE_ELEMENT );660 range.enlarge( CKEDITOR.ENLARGE_ELEMENT, 1 ); 661 661 662 662 var bookmark = range.createBookmark(),
Note: See TracChangeset
for help on using the changeset viewer.
