Ticket #6432: 6432_5.patch

File 6432_5.patch, 2.1 KB (added by Garry Yao, 13 years ago)
  • _source/core/dom/walker.js

     
    421421                };
    422422        };
    423423
     424        CKEDITOR.dom.walker.nodeType = function( type, isReject )
     425        {
     426                return function( node )
     427                {
     428                        return !! ( isReject ^ ( node.type == type ) );
     429                };
     430        };
     431
    424432        var tailNbspRegex = /^[\t\r\n ]*(?: |\xa0)$/,
    425433                isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( 1 ),
    426434                isNotBookmark = CKEDITOR.dom.walker.bookmark( 0, 1 ),
  • _source/core/dom/range.js

     
    373373                        if ( this.collapsed )
    374374                                return;
    375375
     376                        this.fixListRange();
    376377                        execContentsAction( this, 0 );
    377378                },
    378379
     
    19091910                                return container ;
    19101911
    19111912                        return container.getChild( this.endOffset - 1 ) || container ;
    1912                 }
    1913         };
     1913                },
     1914
     1915                // Fix list selection range where entire range is selected from the inner side.
     1916                // <ul><li>[...]</li></ul> =>   [<ul><li>...</li></ul>]
     1917                fixListRange : (function()
     1918                {
     1919                        function moveListBoundary( fixEnd )
     1920                        {
     1921                                var listItem, listRoot;
     1922                                if ( ( listItem = this[ fixEnd ? 'endContainer' : 'startContainer' ].getAscendant( 'li', 1 ) )
     1923                                                && this.checkBoundaryOfElement( listItem, fixEnd ? CKEDITOR.END : CKEDITOR.START )
     1924                                                && ( listRoot = listItem.getParent() )
     1925                                                && ( listItem.equals( listRoot[ fixEnd ? 'getLast' : 'getFirst' ]( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) ) ) )
     1926                                                // Make the fix only when both sides are in same situation.
     1927                                                && ( fixEnd || moveListBoundary.call( this, 1 ) ) )
     1928                                {
     1929                                        this[ fixEnd ? 'setEndAt' : 'setStartAt' ]( listRoot, fixEnd ?
     1930                                                CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START );
     1931                                        return true;
     1932                                }
     1933                        }
     1934
     1935                        return function()
     1936                        {
     1937                                moveListBoundary.call( this );
     1938                        };
     1939                })()
     1940        };
    19141941})();
    19151942
    19161943CKEDITOR.POSITION_AFTER_START   = 1;    // <element>^contents</element>         "^text"
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy