Ticket #1659: 1659_5.patch

File 1659_5.patch, 3.4 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    115115                }
    116116        }
    117117
     118        function styleStringsToNumber( styleStrings )
     119        {
     120                var sum = 0;
     121                for ( var i = 0 ; i < styleStrings.length ; i++ )
     122                        sum += parseInt( styleStrings[ i ], 10 ) || 0;
     123                return sum;
     124        }
     125
    118126        CKEDITOR.plugins.add( 'wysiwygarea',
    119127        {
    120128                requires : [ 'editingblock' ],
     
    247255                                                        body.disabled = true;
    248256                                                        body.contentEditable = true;
    249257                                                        body.removeAttribute( 'disabled' );
     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                                                        }
    250293                                                }
    251294                                                else
    252295                                                        domDocument.designMode = 'on';
     
    329372                                                                }
    330373                                                        },
    331374                                                        0 );
     375
     376                                                // Avoid memory leaks - we're dealing with raw DOM nodes here.
     377                                                body = null;
    332378                                        };
    333379
    334380                                        editor.addMode( 'wysiwyg',
  • _source/core/dom/element.js

     
    13541354                getChildCount : function()
    13551355                {
    13561356                        return this.$.childNodes.length;
    1357                 },
    1358 
     1357                }
    13591358        });
  • contents.css

     
    22Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
    33For licensing, see LICENSE.html or http://ckeditor.com/license
    44*/
    5 
     5html
     6{
     7        /* #1569 fix for IE6 */
     8        _padding: 10px;
     9}
    610body
    711{
    812        /* Font */
     
    1418
    1519        /* Remove the background color to make it transparent */
    1620        background-color: #fff;
     21
     22        /* #1569 fix for IE6 */
     23        _margin: 0px;
     24        _height: 100%;
    1725}
    1826img:-moz-broken
    1927{
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy