Ticket #6432: 6432_4.patch

File 6432_4.patch, 2.2 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                        if ( CKEDITOR.env.ie )
     377                                this.fixListRange();
    376378                        execContentsAction( this, 0 );
    377379                },
    378380
     
    19091911                                return container ;
    19101912
    19111913                        return container.getChild( this.endOffset - 1 ) || container ;
    1912                 }
    1913         };
     1914                },
     1915
     1916                // Fix IE list selection where range never anchors around list root but list items.
     1917                // <ul><li>[...]</li></ul> =>   [<ul><li>...</li></ul>]
     1918                fixListRange : (function()
     1919                {
     1920                        function moveListBoundary( fixEnd )
     1921                        {
     1922                                var listItem, listRoot;
     1923                                if ( ( listItem = this[ fixEnd ? 'endContainer' : 'startContainer' ].getAscendant( 'li', 1 ) )
     1924                                                && this.checkBoundaryOfElement( listItem, fixEnd ? CKEDITOR.END : CKEDITOR.START )
     1925                                                && ( listRoot = listItem.getParent() )
     1926                                                && ( listItem.equals( listRoot[ fixEnd ? 'getLast' : 'getFirst' ]( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) ) ) )
     1927                                                // Make the fix only when both sides are in same situation.
     1928                                                && ( fixEnd || moveListBoundary.call( this, 1 ) ) )
     1929                                {
     1930                                        this[ fixEnd ? 'setEndAt' : 'setStartAt' ]( listRoot, fixEnd ?
     1931                                                CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START );
     1932                                        return true;
     1933                                }
     1934                        }
     1935
     1936                        return function()
     1937                        {
     1938                                moveListBoundary.call( this );
     1939                        };
     1940                })()
     1941        };
    19141942})();
    19151943
    19161944CKEDITOR.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