Ticket #9386: 9386.patch
File 9386.patch, 5.2 KB (added by , 12 years ago) |
---|
-
_source/plugins/selection/plugin.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
78 78 && node.getName() in CKEDITOR.dtd.$removeEmpty; 79 79 } 80 80 81 var start = range.startContainer, 82 offset = range.startOffset; 81 var container = range.startContainer; 83 82 84 if ( start.type == CKEDITOR.NODE_TEXT ) 83 // <body> is free of the fix. 84 if ( container.is( 'body' ) ) 85 85 return false; 86 86 87 // 1. Empty inline element. <span>^</span> 88 // 2. Empty block. <p>^</p> (#7222) 89 // 3. Adjoin to inline element. <p><strong>text</strong>^</p> 90 return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) || start.isBlockBoundary() 91 : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) ); 87 // After inline element. <p><strong>text</strong>^foo</p> 88 var previous = range.getPreviousNode( isVisible, null, container ); 89 if ( isInlineCt( previous ) ) 90 return true; 91 92 var next = range.getNextNode( isVisible, null, container ); 93 // Empty element. <span>^</span>, <p>^</p> (#7222) 94 if ( !( previous || next ) ) 95 return true; 96 97 return false; 92 98 } 93 99 94 100 var selectAllCmd = … … 1737 1743 start.scrollIntoView(); 1738 1744 } 1739 1745 }; 1740 })();1741 1746 1742 ( function()1743 {1744 1747 var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), 1748 isVisible = CKEDITOR.dom.walker.invisible( 1 ); 1745 1749 fillerTextRegex = /\ufeff|\u00a0/, 1746 1750 nonCells = { table:1,tbody:1,tr:1 }; 1747 1751 -
_source/core/dom/walker.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
428 428 var whitespace = CKEDITOR.dom.walker.whitespaces(); 429 429 return function( node ) 430 430 { 431 // Nodes that take no spaces in wysiwyg: 432 // 1. White-spaces but not including NBSP; 433 // 2. Empty inline elements, e.g. <b></b> we're checking here 434 // 'offsetHeight' instead of 'offsetWidth' for properly excluding 435 // all sorts of empty paragraph, e.g. <br />. 436 var isInvisible = whitespace( node ) || node.is && !node.$.offsetHeight; 437 return !! ( isReject ^ isInvisible ); 431 var invisible; 432 433 if ( whitespace( node ) ) 434 invisible = 1; 435 else 436 { 437 // Visibility should be checked on element. 438 if ( node.type == CKEDITOR.NODE_TEXT ) 439 node = node.getParent(); 440 441 // Nodes that take no spaces in wysiwyg: 442 // 1. White-spaces but not including NBSP; 443 // 2. Empty inline elements, e.g. <b></b> we're checking here 444 // 'offsetHeight' instead of 'offsetWidth' for properly excluding 445 // all sorts of empty paragraph, e.g. <br />. 446 invisible = !node.$.offsetHeight; 447 } 448 449 return !! ( isReject ^ invisible ); 438 450 }; 439 451 }; 440 452 -
_source/core/dom/range.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
1876 1876 }, 1877 1877 1878 1878 /** 1879 * Check if elements at which the range boundaries anchor are read-only, 1880 * with respect to "contenteditable" attribute. 1879 * Traverse with {@link CKEDITOR.dom.walker} to retrieve the previous element before the range start. 1880 * @param {Function} evaluator Function used as the walker's evaluator. 1881 * @param {Function} [guard] Function used as the walker's guard. 1882 * @param {CKEDITOR.dom.element} [boundary] A range ancestor element in which the traversal is limited, 1883 * default to the root editable if not defined. 1884 * 1885 * @return {CKEDITOR.dom.element|null} The returned node from the traversal. 1881 1886 */ 1887 getPreviousNode : function( evaluator, guard, boundary ) { 1888 1889 var walkerRange = this.clone(); 1890 walkerRange.collapse( 1 ); 1891 walkerRange.setStartAt( boundary || this.document.getBody(), CKEDITOR.POSITION_AFTER_START ); 1892 1893 var walker = new CKEDITOR.dom.walker( walkerRange ); 1894 walker.evaluator = evaluator; 1895 walker.guard = guard; 1896 return walker.previous(); 1897 }, 1898 1899 /** 1900 * Traverse with {@link CKEDITOR.dom.walker} to retrieve the next element before the range start. 1901 * @param {Function} evaluator Function used as the walker's evaluator. 1902 * @param {Function} [guard] Function used as the walker's guard. 1903 * @param {CKEDITOR.dom.element} [boundary] A range ancestor element in which the traversal is limited, 1904 * default to the root editable if not defined. 1905 * 1906 * @return {CKEDITOR.dom.element|null} The returned node from the traversal. 1907 */ 1908 getNextNode: function( evaluator, guard, boundary ) 1909 { 1910 var walkerRange = this.clone(); 1911 walkerRange.collapse(); 1912 walkerRange.setEndAt( boundary || this.document.getBody(), CKEDITOR.POSITION_BEFORE_END ); 1913 1914 var walker = new CKEDITOR.dom.walker( walkerRange ); 1915 walker.evaluator = evaluator; 1916 walker.guard = guard; 1917 return walker.next(); 1918 }, 1919 1882 1920 checkReadOnly : ( function() 1883 1921 { 1884 1922 function checkNodesEditable( node, anotherEnd )