Ticket #4677: 4677.patch

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

     
    13901390                                        if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) )
    13911391                                                event.data.preventDefault();
    13921392                                } );
     1393                },
     1394
     1395                isVisible : function()
     1396                {
     1397                        var elementWindow = this.getWindow(),
     1398                                elementFrame,
     1399                                isVisible = !!this.$.offsetHeight;
     1400
     1401                        // Webkit and Opera report non-zero offsetHeight despite that
     1402                        // element is inside an invisible iframe. (#4542)
     1403                        if( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera )
     1404                                && !elementWindow.equals( CKEDITOR.document.getWindow() )
     1405                                && ( elementFrame = elementWindow.$.frameElement ) )
     1406                                isVisible = !!elementFrame.offsetHeight;
     1407
     1408                        return isVisible;
    13931409                }
    13941410        });
  • _test/dt/core/dom/element.html

     
    1111{
    1212        // Local reference to the "assert" object.
    1313        var assert = CKEDITOR.test.assert;
    14         var getInnerHtml = CKEDITOR.test.getInnerHtml;
     14        var getInnerHtml = CKEDITOR.test.getInnerHtml,
     15                doc = CKEDITOR.document;
    1516
    1617        return {
    1718                test_$ : function()
     
    551552                        assert.areSame( span1.$, last.$ );
    552553                },
    553554
     555                test_invisible : function()
     556                {
     557                        assert.isFalse( doc.getById( 'invisible1' ).isVisible() );     
     558                },
    554559
    555560                name : document.title
    556561        };
     
    605610                {
    606611                        background-color: red;
    607612                }
     613                .invisible
     614                {
     615                        display: none;
     616                }
    608617        </style>
    609618</head>
    610619<body>
     
    631640        <small title="Testing">Test</small>
    632641
    633642        <div class="block1 scroll" id="block1"><div class="block2 scroll" id="block2"><div class="block3 scroll" id="block3"><div class="block4 scroll" id="block4"><div id="DocPositionTarget">target</div></div></div></div></div>
    634 
     643        <span id="invisible1" class="invisible">This is an invisible element</span>
    635644</body>
    636645</html>
  • _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