Ticket #7041: 7041_2.patch

File 7041_2.patch, 2.7 KB (added by Garry Yao, 13 years ago)
  • _source/core/dom/element.js

     
    254254                },
    255255
    256256                /**
    257                 * Retrieve block element's filler node if existed.
    258                 */
    259                 getBogus : function()
    260                 {
    261                         if ( !this.isBlockBoundary() )
    262                                 return null;
    263 
    264                         var lastChild = this.getLast();
    265 
    266                         // Ignore empty/spaces text.
    267                         while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT
    268                                         && !CKEDITOR.tools.rtrim( lastChild.getText() ) )
    269                                 lastChild = lastChild.getPrevious();
    270 
    271                         if ( lastChild &&
    272                                         ( CKEDITOR.env.ie && lastChild.type == CKEDITOR.NODE_TEXT
    273                                                         && CKEDITOR.tools.trim( lastChild.getText() ).match( /^(?: |\xa0)$/ )
    274                                                         || CKEDITOR.env.gecko && CKEDITOR.env.webkit && lastChild.is( 'br' ) ) )
    275                         {
    276                                 return lastChild;
    277                         }
    278 
    279                         return null;
    280                 },
    281 
    282                 /**
    283257                 * Breaks one of the ancestor element in the element position, moving
    284258                 * this element between the broken parts.
    285259                 * @param {CKEDITOR.dom.element} parent The anscestor element to get broken.
  • _source/plugins/wysiwygarea/plugin.js

     
    357357                        body = editor.document.getBody(),
    358358                        enterMode = editor.config.enterMode;
    359359
    360                 CKEDITOR.env.gecko && activateEditing( editor );
     360                if ( CKEDITOR.env.gecko )
     361                {
     362                        activateEditing( editor );
    361363
     364                        // Ensure bogus br could help to move cursor (out of styles) to the end of block. (#7041)
     365                        var pathBlock = path.block || path.blockLimit;
     366                        if ( pathBlock && !pathBlock.getBogus() )
     367                                pathBlock.appendBogus();
     368                }
     369
    362370                // When enterMode set to block, we'll establing new paragraph only if we're
    363371                // selecting inline contents right under body. (#3657)
    364372                if ( enterMode != CKEDITOR.ENTER_BR
  • _source/core/dom/range.js

     
    10681068                                                                if ( commonReached )
    10691069                                                                        endTop = enlargeable;
    10701070                                                                else if ( enlargeable )
    1071                                                                         this.setEndAfter( enlargeable );
    1072                                                         }
     1071                                                                {
     1072                                                                        var bogus = enlargeable.isBlockBoundary() && enlargeable.getBogus();
     1073
     1074                                                                        // Exclude bogus <br /> at the end of block.
     1075                                                                        if ( bogus )
     1076                                                                                this.setEndBefore( bogus );
     1077                                                                        else
     1078                                                                                this.setEndAfter( enlargeable );
     1079                                                                }
     1080                                                        }
    10731081
    10741082                                                        sibling = enlargeable.getNext();
    10751083                                                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy