Ticket #3473: 3473.patch

File 3473.patch, 1.9 KB (added by Garry Yao, 15 years ago)
  • _source/core/dom/element.js

     
    239239                        var lastChild = this.getLast() ;
    240240
    241241                        // Ignore empty/spaces text.
    242                         while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim( lastChild.getText() ) )
     242                        while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT
     243                                && !CKEDITOR.tools.rtrim( lastChild.getText() || '' ) )
    243244                                lastChild = lastChild.getPrevious();
    244245
    245                         if ( !lastChild || ( lastChild.is && ( !lastChild.is( 'br' ) || !lastChild.getAttribute( '_cke_bogus' ) ) ) )
     246                        // Padding br already existed?
     247                        if ( !lastChild || ( lastChild.is && !lastChild.is( 'br' ) ) )
    246248                        {
    247                                 this.append(
    248                                         CKEDITOR.env.opera ?
    249                                                 this.getDocument().createText('') :
    250                                                 this.getDocument().createElement( 'br', { attributes : { _cke_bogus : 1 } } ) );
     249                                // See whether the block has some line content,
     250                                // empty spaces are ingnored since it's unable to establish line height.
     251                                if ( !CKEDITOR.tools.trim( this.getText() || '' ) )
     252                                        this.append( this.getDocument().createElement( 'br', { attributes : { _cke_bogus : 1 } } ) );
    251253                        }
    252254                },
    253255
     
    666668                {
    667669                        return this.$.style[ CKEDITOR.tools.cssStyleToDomStyle( name ) ];
    668670                },
    669 
     671               
    670672                /**
    671673                 * Checks if the element name matches one or more names.
    672674                 * @param {String} name[,name[,...]] One or more names to be checked.
     
    11651167                        if ( CKEDITOR.env.gecko && !CKEDITOR.env.quirks )
    11661168                        {
    11671169                                x += this.$.clientLeft ? 1 : 0;
    1168                                 y += this.$.clientTop ? 1 : 0;;
     1170                                y += this.$.clientTop ? 1 : 0;
    11691171                        }
    11701172
    11711173                        return { x : x, y : y };
     
    13541356                getChildCount : function()
    13551357                {
    13561358                        return this.$.childNodes.length;
    1357                 },
    1358 
     1359                }
    13591360        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy