Index: _source/plugins/clipboard/plugin.js =================================================================== --- _source/plugins/clipboard/plugin.js (revision 7006) +++ _source/plugins/clipboard/plugin.js (revision ) @@ -226,7 +226,11 @@ // Wait a while and grab the pasted contents window.setTimeout( function() { - mode == 'text' && CKEDITOR.env.gecko && editor.focusGrabber.focus(); + // Gecko need to move focus back from the textarea + // to blink the cursor. (#5684) + if ( mode == 'text' && CKEDITOR.env.gecko ) + editor.document.getBody().focus(); + pastebin.remove(); editor.removeListener( 'selectionChange', cancel ); Index: _source/plugins/editingblock/plugin.js =================================================================== --- _source/plugins/editingblock/plugin.js (revision 7010) +++ _source/plugins/editingblock/plugin.js (revision ) @@ -1,0 +1,0 @@ Index: _source/plugins/wysiwygarea/plugin.js =================================================================== --- _source/plugins/wysiwygarea/plugin.js (revision 6973) +++ _source/plugins/wysiwygarea/plugin.js (revision ) @@ -703,28 +703,6 @@ } ); } - // IE standard compliant in editing frame doesn't focus the editor when - // clicking outside actual content, manually apply the focus. (#1659) - if ( editable && - CKEDITOR.env.ie && domDocument.$.compatMode == 'CSS1Compat' - || CKEDITOR.env.gecko - || CKEDITOR.env.opera ) - { - var htmlElement = domDocument.getDocumentElement(); - htmlElement.on( 'mousedown', function( evt ) - { - // Setting focus directly on editor doesn't work, we - // have to use here a temporary element to 'redirect' - // the focus. - if ( evt.data.getTarget().equals( htmlElement ) ) - { - if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 ) - blinkCursor(); - focusGrabber.focus(); - } - } ); - } - var focusTarget = CKEDITOR.env.ie ? iframe : domWindow; focusTarget.on( 'blur', function() { @@ -1205,31 +1183,6 @@ }); } - // Create an invisible element to grab focus. - if ( CKEDITOR.env.gecko || CKEDITOR.env.ie || CKEDITOR.env.opera ) - { - var focusGrabber; - editor.on( 'uiReady', function() - { - focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml( - // Use 'span' instead of anything else to fly under the screen-reader radar. (#5049) - '' ) ); - - focusGrabber.on( 'focus', function() - { - editor.focus(); - } ); - - editor.focusGrabber = focusGrabber; - } ); - editor.on( 'destroy', function() - { - CKEDITOR.tools.removeFunction( contentDomReadyHandler ); - focusGrabber.clearCustomData(); - delete editor.focusGrabber; - } ); - } - // Disable form elements editing mode provided by some browers. (#5746) editor.on( 'insertElement', function ( evt ) { Index: _source/plugins/selection/plugin.js =================================================================== --- _source/plugins/selection/plugin.js (revision 6993) +++ _source/plugins/selection/plugin.js (revision ) @@ -341,20 +341,6 @@ restoreEnabled = 1; }); - // In IE6/7 the blinking cursor appears, but contents are - // not editable. (#5634) - if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.version < 8 || CKEDITOR.env.quirks ) ) - { - // The 'click' event is not fired when clicking the - // scrollbars, so we can use it to check whether - // the empty space following has been clicked. - html.on( 'click', function( evt ) - { - if ( evt.data.getTarget().getName() == 'html' ) - editor.getSelection().getRanges()[ 0 ].select(); - }); - } - var scroll; // IE fires the "selectionchange" event when clicking // inside a selection. We don't want to capture that. @@ -399,7 +385,47 @@ saveSelection(); }); + if ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) + { + html.$.unselectable = 'on'; + // The 'click' event is not fired when clicking the + // scrollbars, so we can use it to check whether + // the empty space following has been clicked. + html.on( 'click', function( evt ) + { + if ( evt.data.getTarget().getName() != 'html' || editor.focusManager.hasFocus ) + return; + editor.focus(); + + // Manually trigger range restore. + if ( savedRange ) + body.focus(); + // Without a selection, the cursor blinks, but contents are not editable. (#5634) + else + editor.getSelection().getRanges()[ 0 ].select(); + }); + } + + + if ( CKEDITOR.env.ie8 ) + { + // When content doc is in standards mode, IE doesn't focus the editor when + // clicking on outside body (on html element) content, manually apply the + // selection helps. (#1659, #7932) + html.on( 'mouseup', function( evt ) + { + if ( evt.data.getTarget().getName() == 'html' ) + { + var sel = CKEDITOR.document.$.selection, + range = sel.createRange(); + // The selection range is reported on host, but actually it should applies to the content doc. + if ( sel.type != 'None' && range.parentElement().ownerDocument == doc.$ ) + range.select(); + } + } ); + } + // IE is the only to provide the "selectionchange" // event. doc.on( 'selectionchange', saveSelection );