Ticket #8087: 8087_2.patch
File 8087_2.patch, 2.9 KB (added by , 13 years ago) |
---|
-
_source/core/dom/element.js
1595 1595 */ 1596 1596 getDirection : function( useComputed ) 1597 1597 { 1598 return useComputed ? 1599 this.getComputedStyle( 'direction' ) 1600 // Webkit: offline element returns empty direction (#8053). 1601 || this.getDirection() 1602 || this.getDocument().$.dir 1603 || this.getDocument().getBody().getDirection( 1 ) 1604 : this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); 1598 if ( useComputed ) 1599 { 1600 var dir = this.getComputedStyle( 'direction' ) || this.getDirection(); 1601 1602 // Webkit: offline element won't inherit direction from parents (#8053). 1603 if ( !dir ) 1604 { 1605 var parents = this.getParents( 1 ); 1606 for ( var i = 0, count = parents.length; i < count; i++ ) 1607 { 1608 if ( dir = parents[ i ].getDirection() ) 1609 return dir; 1610 } 1611 } 1612 1613 return dir; 1614 } 1615 else 1616 return this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); 1605 1617 }, 1606 1618 1607 1619 /** -
_source/plugins/list/plugin.js
107 107 108 108 if ( orgDir != rootNode.getDirection( 1 ) ) 109 109 currentListItem.setAttribute( 'dir', orgDir ); 110 else111 currentListItem.removeAttribute( 'dir' );112 110 113 111 for ( var i = 0 ; i < item.contents.length ; i++ ) 114 112 currentListItem.append( item.contents[i].clone( 1, 1 ) ); … … 155 153 { 156 154 if ( item.grandparent.getDirection( 1 ) != orgDir ) 157 155 currentListItem.setAttribute( 'dir', orgDir ); 158 else159 currentListItem.removeAttribute( 'dir' );160 156 } 161 157 162 158 for ( i = 0 ; i < item.contents.length ; i++ ) … … 208 204 break; 209 205 } 210 206 211 // Clear marker attributes for the new list tree made of cloned nodes, if any.212 207 if ( database ) 213 208 { 214 var currentNode = retval.getFirst(); 209 var currentNode = retval.getFirst(), 210 itemDir, 211 listRoot = listArray[ 0 ].parent; 212 215 213 while ( currentNode ) 216 214 { 217 215 if ( currentNode.type == CKEDITOR.NODE_ELEMENT ) 216 { 217 // Clear marker attributes for the new list tree made of cloned nodes, if any. 218 218 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 219 229 currentNode = currentNode.getNextSourceNode(); 220 230 } 221 231 }