Ticket #4147: 4147.patch
File 4147.patch, 3.3 KB (added by , 15 years ago) |
---|
-
_source/plugins/styles/plugin.js
197 197 { 198 198 if ( attName == '_length' ) 199 199 continue; 200 if ( attribs[attName] == element.getAttribute( attName ) ) 200 var elementAttr = element.getAttribute( attName ); 201 202 if ( attribs[attName] == 203 ( attName == 'style' ? 204 normalizeCssText( elementAttr, false ) : elementAttr ) ) 201 205 { 202 206 if ( !fullMatch ) 203 207 return true; … … 1178 1182 return overrides; 1179 1183 } 1180 1184 1181 function normalizeCssText( unparsedCssText )1185 function normalizeCssText( unparsedCssText, nativeNormalize ) 1182 1186 { 1183 // Injects the style in a temporary span object, so the browser parses it, 1184 // retrieving its final format. 1185 var temp = new CKEDITOR.dom.element( 'span' ); 1186 temp.setAttribute( 'style', unparsedCssText ); 1187 var styleText = temp.getAttribute( 'style' ); 1188 // IE will leave a single semicolon when failed to parse the style text.(#3891) 1189 return styleText == ';' ? '' : styleText; 1190 } 1187 var styleText; 1188 if ( nativeNormalize != false ) 1189 { 1190 // Injects the style in a temporary span object, so the browser parses it, 1191 // retrieving its final format. 1192 var temp = new CKEDITOR.dom.element( 'span' ); 1193 temp.setAttribute( 'style', unparsedCssText ); 1194 styleText = temp.getAttribute( 'style' ); 1195 } 1196 else 1197 styleText = unparsedCssText; 1191 1198 1199 // Shrinking white-spaces around colon(#4147). 1200 // Shrinking white-spaces around semi-colon. 1201 // Compensate tail semi-colon. 1202 return styleText.replace( /\s*:\s*/, ':' ) 1203 .replace( /\s*(?:;\s*|$)/, ';' ) 1204 .replace( /([^\s;])$/, '$1;') 1205 .toLowerCase(); 1206 1207 } 1208 1192 1209 function applyStyle( document, remove ) 1193 1210 { 1194 1211 // Get all ranges from the selection. -
_source/core/dom/element.js
430 430 431 431 case 'style': 432 432 // IE does not return inline styles via getAttribute(). See #2947. 433 var styleText = this.$.style.cssText; 434 return styleText.toLowerCase().replace( 435 /\s*(?:;\s*|$)/, ';').replace( 436 /([^;])$/, '$1;'); 433 return this.$.style.cssText; 437 434 } 438 435 439 436 return standard.call( this, name ); -
CHANGES.html
216 216 <li><a href="http://dev.fckeditor.net/ticket/4144">#4144</a> : Fixed the white-spaces at the end of <pre> is incorrectly removed.</li> 217 217 <li><a href="http://dev.fckeditor.net/ticket/4143">#4143</a> : Fixed element id is lost when extracting contents from the range.</li> 218 218 <li><a href="http://dev.fckeditor.net/ticket/4007">#4007</a> : [IE] Source area overflow from editor chrome.</li> 219 <li><a href="http://dev.fckeditor.net/ticket/4147">#4147</a> : Unify style text normalization logic when comparing styles.</li> 219 220 </ul> 220 221 <h3> 221 222 CKEditor 3.0 RC</h3>