Ticket #8087: 8087.patch

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

     
    15991599                                this.getComputedStyle( 'direction' )
    16001600                                        // Webkit: offline element returns empty direction (#8053).
    16011601                                        || this.getDirection()
    1602                                         || this.getDocument().$.dir
    1603                                         || this.getDocument().getBody().getDirection( 1 )
    16041602                                : this.getStyle( 'direction' ) || this.getAttribute( 'dir' );
    16051603                },
    16061604
  • _source/plugins/list/plugin.js

     
    107107
    108108                                        if ( orgDir != rootNode.getDirection( 1 ) )
    109109                                                currentListItem.setAttribute( 'dir', orgDir );
    110                                         else
    111                                                 currentListItem.removeAttribute( 'dir' );
    112110
    113111                                        for ( var i = 0 ; i < item.contents.length ; i++ )
    114112                                                currentListItem.append( item.contents[i].clone( 1, 1 ) );
     
    155153                                        {
    156154                                                if ( item.grandparent.getDirection( 1 ) != orgDir )
    157155                                                        currentListItem.setAttribute( 'dir', orgDir );
    158                                                 else
    159                                                         currentListItem.removeAttribute( 'dir' );
    160156                                        }
    161157
    162158                                        for ( i = 0 ; i < item.contents.length ; i++ )
     
    208204                                        break;
    209205                        }
    210206
    211                         // Clear marker attributes for the new list tree made of cloned nodes, if any.
    212207                        if ( database )
    213208                        {
    214                                 var currentNode = retval.getFirst();
     209                                var currentNode = retval.getFirst(),
     210                                        itemDir,
     211                                        listRoot = listArray[ 0 ].parent;
     212
    215213                                while ( currentNode )
    216214                                {
    217215                                        if ( currentNode.type == CKEDITOR.NODE_ELEMENT )
     216                                        {
     217                                                // Clear marker attributes for the new list tree made of cloned nodes, if any.
    218218                                                CKEDITOR.dom.element.clearMarkers( database, currentNode );
     219
     220                                                // Clear redundant direction attribute.
     221                                                if ( currentNode.is( 'li' ) && ( itemDir = currentNode.getDirection() ) )
     222                                                {
     223                                                        var listNode = currentNode.getParent();
     224                                                        if ( itemDir == ( listNode && listNode.getDirection( 1 ) || listRoot.getDirection( 1 ) ) )
     225                                                                currentNode.removeAttribute( 'dir' );
     226                                                }
     227                                        }
     228
    219229                                        currentNode = currentNode.getNextSourceNode();
    220230                                }
    221231                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy