Ticket #4677: 4677.patch
File 4677.patch, 3.7 KB (added by , 14 years ago) |
---|
-
_source/core/dom/element.js
1390 1390 if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) ) 1391 1391 event.data.preventDefault(); 1392 1392 } ); 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; 1393 1409 } 1394 1410 }); -
_test/dt/core/dom/element.html
11 11 { 12 12 // Local reference to the "assert" object. 13 13 var assert = CKEDITOR.test.assert; 14 var getInnerHtml = CKEDITOR.test.getInnerHtml; 14 var getInnerHtml = CKEDITOR.test.getInnerHtml, 15 doc = CKEDITOR.document; 15 16 16 17 return { 17 18 test_$ : function() … … 551 552 assert.areSame( span1.$, last.$ ); 552 553 }, 553 554 555 test_invisible : function() 556 { 557 assert.isFalse( doc.getById( 'invisible1' ).isVisible() ); 558 }, 554 559 555 560 name : document.title 556 561 }; … … 605 610 { 606 611 background-color: red; 607 612 } 613 .invisible 614 { 615 display: none; 616 } 608 617 </style> 609 618 </head> 610 619 <body> … … 631 640 <small title="Testing">Test</small> 632 641 633 642 <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> 635 644 </body> 636 645 </html> -
_source/plugins/dialog/plugin.js
464 464 this.focusIndex = index; 465 465 this.isFocusable = function() 466 466 { 467 return true;467 return !( element.getAttribute( 'disabled' ) || !element.isVisible() ) 468 468 }; 469 469 this.focus = function() 470 470 { … … 2460 2460 */ 2461 2461 isVisible : function() 2462 2462 { 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(); 2476 2464 }, 2477 2465 2478 2466 /** -
_source/plugins/dialogui/plugin.js
838 838 839 839 isVisible : function() 840 840 { 841 return !!this.getElement().$.firstChild.offsetHeight;841 return this.getElement().getFirst().isVisible(); 842 842 }, 843 843 844 844 isEnabled : function()