X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fwysiwygarea%2Fplugin.js;h=5a0aca8a52abf45008298dbc85dc4a19ee8b63b7;hp=ed278c712f41ea6e557589e21fc35b17e4dcf826;hb=66f4ae0bf0280ed56bf7c0f4ab175424dd1d47a0;hpb=f8fc585c18d287eb325c575596d183122486b641
diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js
index ed278c7..5a0aca8 100644
--- a/_source/plugins/wysiwygarea/plugin.js
+++ b/_source/plugins/wysiwygarea/plugin.js
@@ -478,7 +478,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// the focus.
if ( evt.data.getTarget().equals( htmlElement ) )
{
- CKEDITOR.env.gecko && blinkCursor();
+ if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 )
+ blinkCursor();
focusGrabber.focus();
}
} );
@@ -492,7 +493,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
domWindow.on( 'focus', function()
{
var doc = editor.document;
- if ( CKEDITOR.env.gecko || CKEDITOR.env.opera )
+
+ if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 )
+ blinkCursor();
+ else if ( CKEDITOR.env.opera )
doc.getBody().focus();
else if ( CKEDITOR.env.webkit )
{
@@ -707,8 +711,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
config.docType +
'' +
- '
' + frameLabel + '' +
'' +
+ '' + frameLabel + '' +
baseTag +
headExtra +
'' +
@@ -815,17 +819,41 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// IE8 stricts mode doesn't have 'contentEditable' in effect
// on element unless it has layout. (#5562)
- if ( CKEDITOR.env.ie8 )
+ if ( CKEDITOR.env.ie8Compat )
+ {
editor.addCss( 'html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}' );
+ var selectors = [];
+ for ( var tag in CKEDITOR.dtd.$removeEmpty )
+ selectors.push( 'html.CSS1Compat ' + tag + '[contenteditable=false]' );
+ editor.addCss( selectors.join( ',' ) + '{ display:inline-block;}' );
+ }
+
// Switch on design mode for a short while and close it after then.
- function blinkCursor()
+ function blinkCursor( retry )
{
- editor.document.$.designMode = 'on';
- setTimeout( function ()
- {
- editor.document.$.designMode = 'off';
- }, 50 );
+ CKEDITOR.tools.tryThese(
+ function()
+ {
+ editor.document.$.designMode = 'on';
+ setTimeout( function ()
+ {
+ editor.document.$.designMode = 'off';
+ editor.document.getBody().focus();
+ }, 50 );
+ },
+ function()
+ {
+ // The above call is known to fail when parent DOM
+ // tree layout changes may break design mode. (#5782)
+ // Refresh the 'contentEditable' is a cue to this.
+ editor.document.$.designMode = 'off';
+ var body = editor.document.getBody();
+ body.setAttribute( 'contentEditable', false );
+ body.setAttribute( 'contentEditable', true );
+ // Try it again once..
+ !retry && blinkCursor( 1 );
+ });
}
// Create an invisible element to grab focus.