Ticket #4677: 4677_2.patch

File 4677_2.patch, 2.5 KB (added by Garry Yao, 14 years ago)
  • _source/core/dom/element.js

     
    739739                 */
    740740                isVisible : function()
    741741                {
    742                         return this.$.offsetWidth && ( this.$.style.visibility != 'hidden' );
     742                        {
     743                                var elementWindow = this.getWindow(),
     744                                        elementFrame,
     745                                        isVisible = !!this.$.offsetHeight && this.getComputedStyle( 'visibility' ) != 'hidden';
     746
     747                                // Webkit and Opera report non-zero offsetHeight despite that
     748                                // element is inside an invisible iframe. (#4542)
     749                                if( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera )
     750                                        && !elementWindow.equals( CKEDITOR.document.getWindow() )
     751                                        && ( elementFrame = elementWindow.$.frameElement ) )
     752                                        isVisible = new CKEDITOR.dom.element( elementFrame ).isVisible();
     753
     754                                return isVisible;
     755                        }
    743756                },
    744757
    745758                /**
  • _source/plugins/dialog/plugin.js

     
    464464                this.focusIndex = index;
    465465                this.isFocusable = function()
    466466                {
    467                         return true;
     467                        return !( element.getAttribute( 'disabled' ) || !element.isVisible() )
    468468                };
    469469                this.focus = function()
    470470                {
     
    24602460                 */
    24612461                isVisible : function()
    24622462                {
    2463                         var element = this.getInputElement(),
    2464                                 elementWindow = element.getWindow(),
    2465                                 elementFrame,
    2466                                 isVisible = !!element.$.offsetHeight;
    2467 
    2468                         // Webkit and Opera report non-zero offsetHeight despite that
    2469                         // element is inside an invisible iframe. (#4542)
    2470                         if( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera )
    2471                                 && !elementWindow.equals( CKEDITOR.document.getWindow() )
    2472                                 && ( elementFrame = elementWindow.$.frameElement ) )
    2473                                 isVisible = !!elementFrame.offsetHeight;
    2474 
    2475                         return isVisible;
     2463                        return this.getInputElement().isVisible();
    24762464                },
    24772465
    24782466                /**
  • _source/plugins/dialogui/plugin.js

     
    838838
    839839                                isVisible : function()
    840840                                {
    841                                         return !!this.getElement().$.firstChild.offsetHeight;
     841                                        return this.getElement().getFirst().isVisible();
    842842                                },
    843843
    844844                                isEnabled : function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy