| 258 | |
| 259 | // #1659: Editing area should fill the editable frame in IE (IE7+ part). |
| 260 | if ( CKEDITOR.env.version >= 7 && domDocument.compatMode == 'CSS1Compat' ) |
| 261 | { |
| 262 | |
| 263 | var resizeFunc = CKEDITOR.tools.bind( function() |
| 264 | { |
| 265 | var htmlStyles = this.documentElement.currentStyle; |
| 266 | var bodyStyles = this.body.currentStyle; |
| 267 | var margin = styleStringsToNumber( [ htmlStyles.marginTop, htmlStyles.marginBottom, |
| 268 | bodyStyles.marginTop, bodyStyles.marginBottom ] ); |
| 269 | var border = styleStringsToNumber( [ htmlStyles.borderTopWidth, htmlStyles.borderBottomWidth, |
| 270 | bodyStyles.borderTopWidth, bodyStyles.borderBottomWidth ] ); |
| 271 | var padding = styleStringsToNumber( [ htmlStyles.paddingTop, htmlStyles.paddingBottom, |
| 272 | bodyStyles.paddingTop, bodyStyles.paddingBottom ] ); |
| 273 | |
| 274 | // For IE8 only: |
| 275 | // The body tag in IE8 may take the natural top margin of a <p> tag |
| 276 | // into the body margin. |
| 277 | if ( CKEDITOR.env.version >= 8 ) |
| 278 | { |
| 279 | var paragraphs = this.getElementsByTagName( 'p' ); |
| 280 | if ( paragraphs.length > 0 ) |
| 281 | { |
| 282 | var block = paragraphs[ 0 ]; |
| 283 | margin += block.offsetTop || 0; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | this.body.runtimeStyle.minHeight = ( this.documentElement.clientHeight - margin - border - padding ) + 'px'; |
| 288 | }, domDocument ); |
| 289 | |
| 290 | domWindow.attachEvent( 'onresize', resizeFunc ); |
| 291 | resizeFunc(); |
| 292 | } |