+ } );\r
+\r
+ // PageUp/PageDown scrolling is broken in document\r
+ // with standard doctype, manually fix it. (#4736)\r
+ if ( CKEDITOR.env.ie && domDocument.$.compatMode == 'CSS1Compat' )\r
+ {\r
+ var pageUpDownKeys = { 33 : 1, 34 : 1 };\r
+ domDocument.on( 'keydown', function( evt )\r
+ {\r
+ if ( evt.data.getKeystroke() in pageUpDownKeys )\r
+ {\r
+ setTimeout( function ()\r
+ {\r
+ editor.getSelection().scrollIntoView();\r
+ }, 0 );\r
+ }\r
+ } );\r
+ }\r
+\r
+ // Prevent IE from leaving new paragraph after deleting all contents in body. (#6966)\r
+ if ( CKEDITOR.env.ie && editor.config.enterMode != CKEDITOR.ENTER_P )\r
+ {\r
+ domDocument.on( 'selectionchange', function()\r
+ {\r
+ var body = domDocument.getBody(),\r
+ sel = editor.getSelection(),\r
+ range = sel && sel.getRanges()[ 0 ];\r
+\r
+ if ( range && body.getHtml().match( /^<p> <\/p>$/i )\r
+ && range.startContainer.equals( body ) )\r
+ {\r
+ // Avoid the ambiguity from a real user cursor position.\r
+ setTimeout( function ()\r
+ {\r
+ range = editor.getSelection().getRanges()[ 0 ];\r
+ if ( !range.startContainer.equals ( 'body' ) )\r
+ {\r
+ body.getFirst().remove( 1 );\r
+ range.moveToElementEditEnd( body );\r
+ range.select( 1 );\r
+ }\r
+ }, 0 );\r
+ }\r
+ });\r