if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat )\r
&& doc.$.compatMode != 'BackCompat' )\r
{\r
- html.on( 'mousedown', function( evt )\r
+ function moveRangeToPoint( range, x, y )\r
{\r
- evt = evt.data.$;\r
+ // Error prune in IE7. (#9034, #9110)\r
+ try { range.moveToPoint( x, y ); } catch ( e ) {}\r
+ }\r
\r
+ html.on( 'mousedown', function( evt )\r
+ {\r
// Expand the text range along with mouse move.\r
function onHover( evt )\r
{\r
{\r
// Read the current cursor.\r
var rngEnd = body.$.createTextRange();\r
- rngEnd.moveToPoint( evt.x, evt.y );\r
+\r
+ moveRangeToPoint( rngEnd, evt.x, evt.y );\r
\r
// Handle drag directions.\r
textRng.setEndPoint(\r
}\r
}\r
\r
+ evt = evt.data.$;\r
+\r
// We're sure that the click happens at the region\r
// below body, but not on scrollbar.\r
if ( evt.y < html.$.clientHeight\r
{\r
// Start to build the text range.\r
var textRng = body.$.createTextRange();\r
- textRng.moveToPoint( evt.x, evt.y );\r
- textRng.select();\r
+ moveRangeToPoint( textRng, evt.x, evt.y );\r
\r
html.on( 'mousemove', onHover );\r
\r
{\r
html.removeListener( 'mousemove', onHover );\r
evt.removeListener();\r
+\r
+ // Make it in effect on mouse up. (#9022)\r
textRng.select();\r
- textRng = null;\r
} );\r
}\r
});\r
command : 'selectAll'\r
});\r
\r
- editor.selectionChange = checkSelectionChangeTimeout;\r
+ /**\r
+ * Check if to fire the {@link CKEDITOR.editor#selectionChange} event\r
+ * for the current editor instance.\r
+ *\r
+ * @param {Boolean} checkNow Check immediately without any delay.\r
+ */\r
+ editor.selectionChange = function( checkNow )\r
+ {\r
+ ( checkNow ? checkSelectionChange : checkSelectionChangeTimeout ).call( this );\r
+ };\r
\r
// IE9 might cease to work if there's an object selection inside the iframe (#7639).\r
CKEDITOR.env.ie9Compat && editor.on( 'destroy', function()\r
this.isLocked = 0;\r
this.reset();\r
\r
- doc.getBody().focus();\r
-\r
if ( selectedElement )\r
this.selectElement( selectedElement );\r
else\r