+ // Gecko need a key event to 'wake up' the editing\r
+ // ability when document is empty.(#3864)\r
+ if ( CKEDITOR.env.gecko )\r
+ {\r
+ var first = body;\r
+ while( first.firstChild )\r
+ first = first.firstChild;\r
+\r
+ if( !first.nextSibling\r
+ && ( 'BR' == first.tagName )\r
+ && first.hasAttribute( '_moz_editor_bogus_node' ) )\r
+ {\r
+ var keyEventSimulate = domDocument.$.createEvent( "KeyEvents" );\r
+ keyEventSimulate.initKeyEvent( 'keypress', true, true, domWindow.$, false,\r
+ false, false, false, 0, 32 );\r
+ domDocument.$.dispatchEvent( keyEventSimulate );\r
+ var bogusText = domDocument.getBody().getFirst() ;\r
+ // Compensate the line maintaining <br> if enterMode is not block.\r
+ if ( editor.config.enterMode == CKEDITOR.ENTER_BR )\r
+ domDocument.createElement( 'br', { attributes: { '_moz_dirty' : "" } } )\r
+ .replace( bogusText );\r
+ else\r
+ bogusText.remove();\r
+ }\r
+ }\r
+\r