Ticket #3529: 3529_2.patch
File 3529_2.patch, 2.5 KB (added by , 15 years ago) |
---|
-
core/dom/text.js
79 79 */ 80 80 split : function( offset ) 81 81 { 82 // If the offset is after the last char, IE creates the text node 83 // on split, but don't include it into the DOM. So, we have to do 84 // that manually here. 85 if ( CKEDITOR.env.ie && offset == this.getLength() ) 82 // @see {@link CKEDITOR.env.support.splitTextAtLastChar}. 83 if ( offset == this.getLength() && !CKEDITOR.env.support.splitTextAtLastChar ) 86 84 { 87 85 var next = this.getDocument().createText( '' ); 88 86 next.insertAfter( this ); … … 92 90 var doc = this.getDocument(); 93 91 var retval = new CKEDITOR.dom.text( this.$.splitText( offset ), doc ); 94 92 95 // IE BUG: IE8 does not update the childNodes array in DOM after splitText(), 96 // we need to make some DOM changes to make it update. (#3436) 97 if ( CKEDITOR.env.ie && CKEDITOR.env.version >= 8 ) 93 // @see {@link CKEDITOR.env.support.splitTextUpdateChildren}. 94 if ( !CKEDITOR.env.support.splitTextUpdateChildren ) 98 95 { 99 96 var workaround = new CKEDITOR.dom.text( '', doc ); 100 97 workaround.insertAfter( retval ); -
core/env.js
192 192 if ( env.gecko && version < 10900 ) 193 193 env.cssClass += ' cke_browser_gecko18'; 194 194 195 // Feature detections below for capabilities of native API on which we rely. 196 var root = document.documentElement; 197 env.support = 198 { 199 // IE BUG: If the offset is after the last char, IE creates the text node 200 // on split, but don't include it into the DOM 201 splitTextAtLastChar : !env.ie, 202 203 // IE BUG: IE8 and it's compatible mode does not update the childNodes 204 // array in DOM after splitText() util next DOM changes. 205 splitTextUpdateChildren : !( env.ie && env.version == 8 ) 206 && ( function() 207 { 208 var parent = document.createElement( 'p' ); 209 parent.innerHTML = 'A B <b>C </b>D E'; 210 root.appendChild( parent ); 211 // Split the text nodes. 212 parent.firstChild.splitText( 2 ); // Right before "B" 213 parent.childNodes[ 3 ].splitText( 2 ); // Right before "E" 214 var childNums = parent.childNodes.length; 215 root.removeChild( parent ); 216 return childNums == 5; 217 } )() 218 }; 219 195 220 return env; 196 221 })(); 197 222 }