Skip to content
Permalink
Browse files

Merge branch 't/10030'

  • Loading branch information...
Reinmar committed Jul 31, 2014
2 parents 6529f66 + 323c558 commit 8a6bb0d3a301448681275341e991b9bfb053c0a1
Showing with 14 additions and 11 deletions.
  1. +1 −0 CHANGES.md
  2. +9 −2 core/dom/document.js
  3. +2 −7 core/selection.js
  4. +2 −2 plugins/floatpanel/plugin.js
@@ -8,6 +8,7 @@ Fixed Issues:
* [#10916](http://dev.ckeditor.com/ticket/10916): Fixed Magicline icon in RTL environments.
* [#11970](http://dev.ckeditor.com/ticket/11970): Fixed: CKEditor paste event not fired when pasting with SHIFT+INS in IE.
* [#12111](http://dev.ckeditor.com/ticket/12111): Fixed: Linked image attributes are not read when opening the image dialog by doubleclick.
* [#10030](http://dev.ckeditor.com/ticket/10030): [IE] Fixed: Prevented "Unspecified Error" thrown in various cases when IE8-9 does not allow access to `document.activeElement`.

## CKEditor 4.4.3

@@ -120,10 +120,17 @@ CKEDITOR.tools.extend( CKEDITOR.dom.document.prototype, {
* An active element does not necessarily have focus,
* but an element with focus is always the active element in a document.
*
* @returns {CKEDITOR.dom.element}
* @returns {CKEDITOR.dom.element} Active element or `null` if encountered IE8-9's bug.
* See [#10030](http://dev.ckeditor.com/ticket/10030).
*/
getActive: function() {
return new CKEDITOR.dom.element( this.$.activeElement );
var $active;
try {
$active = this.$.activeElement;
} catch ( e ) {
return null;
}
return new CKEDITOR.dom.element( $active );
},

/**
@@ -1133,12 +1133,7 @@
fixInitialSelection( root, sel, true );
}
else if ( CKEDITOR.env.ie ) {
var active;

// IE8,9 throw unspecified error when trying to access document.$.activeElement.
try {
active = this.document.getActive();
} catch ( e ) {}
var active = this.document.getActive();

// IEs 9+.
if ( !isMSSelection ) {
@@ -1771,7 +1766,7 @@
this.selectRanges( ranges );
this.lock();
// Return to the previously focused element.
!focused.equals( this.root ) && focused.focus();
focused && !focused.equals( this.root ) && focused.focus();
return;
}

@@ -429,7 +429,7 @@ CKEDITOR.plugins.add( 'floatpanel', {
// order to properly fire the "focus" event.
if ( CKEDITOR.env.webkit ) {
var active = CKEDITOR.document.getActive();
!active.equals( this._.iframe ) && active.$.blur();
active && !active.equals( this._.iframe ) && active.$.blur();
}

// Restore last focused element or simply focus panel window.
@@ -444,7 +444,7 @@ CKEDITOR.plugins.add( 'floatpanel', {
var doc = this._.iframe.getFrameDocument(),
active = doc.getActive();

active.is( 'a' ) && ( this._.lastFocused = active );
active && active.is( 'a' ) && ( this._.lastFocused = active );
},

/**

0 comments on commit 8a6bb0d

Please sign in to comment.
You can’t perform that action at this time.