public/ckeditor/4.4dev/core/selection.js
function fixInitialSelection( root, nativeSel, doFocus ) {
		// It may happen that setting proper selection will
		// cause focus to be fired (even without actually focusing root).
		// Cancel it because focus shouldn't be fired when retriving selection. (#10115)
		var listener = root.on( 'focus', function( evt ) {
			evt.cancel();
		}, null, null, -100 );

		// FF && Webkit.
		if ( !CKEDITOR.env.ie ) {
			var range = new CKEDITOR.dom.range( root );
			range.moveToElementEditStart( root );

			var nativeRange = root.getDocument().$.createRange();
			nativeRange.setStart( range.startContainer.$, range.startOffset );
			nativeRange.collapse( 1 );

			nativeSel.removeAllRanges();
			nativeSel.addRange( nativeRange );
		}
		else {
			// IE in specific case may also fire selectionchange.
			// We cannot block bubbling selectionchange, so at least we
			// can prevent from falling into inf recursion caused by fix for #9699
			// (see wysiwygarea plugin).
			// http://dev.ckeditor.com/ticket/10438#comment:13
			var listener2 = root.getDocument().on( 'selectionchange', function( evt ) {
				evt.cancel();
			}, null, null, -100 );
		}

		doFocus && root.focus();

		listener.removeListener();
		listener2 && listener2.removeListener();
	}
function fixInitialSelection( root, nativeSel, doFocus ) {
		// It may happen that setting proper selection will
		// cause focus to be fired (even without actually focusing root).
		// Cancel it because focus shouldn't be fired when retriving selection. (#10115)
		var listener = root.on( 'focus', function( evt ) {
			evt.cancel();
		}, null, null, -100 );

		// FF && Webkit.
		if ( !CKEDITOR.env.ie ) {
			var range = new CKEDITOR.dom.range( root );
			range.moveToElementEditStart( root );

			var nativeRange = root.getDocument().$.createRange();
			nativeRange.setStart( range.startContainer.$, range.startOffset );
			nativeRange.collapse( 1 );

			nativeSel.removeAllRanges();
			nativeSel.addRange( nativeRange );
		}
		else {
			// IE in specific case may also fire selectionchange.
			// We cannot block bubbling selectionchange, so at least we
			// can prevent from falling into inf recursion caused by fix for #9699
			// (see wysiwygarea plugin).
			// http://dev.ckeditor.com/ticket/10438#comment:13
			var listener2 = root.getDocument().on( 'selectionchange', function( evt ) {
				evt.cancel();
			}, null, null, -100 );
		}

		doFocus && root.focus();

		listener.removeListener();
		listener2 && listener2.removeListener();
	}
function fixInitialSelection ( root , nativeSel , doFocus ) { // It may happen that setting proper selection will // cause focus to be fired (even without actually focusing root). // Cancel it because focus shouldn't be fired when retriving selection. (#10115) var listener = root . on ( 'focus' , function ( evt ) { evt . cancel ( ) ; } , null , null , - 100 ) ; // FF && Webkit. if ( ! CKEDITOR . env . ie ) { var range = new CKEDITOR . dom . range ( root ) ; range . moveToElementEditStart ( root ) ; var nativeRange = root . getDocument ( ) . $ . createRange ( ) ; nativeRange . setStart ( range . startContainer . $ , range . startOffset ) ; nativeRange . collapse ( 1 ) ; nativeSel . removeAllRanges ( ) ; nativeSel . addRange ( nativeRange ) ; } else { // IE in specific case may also fire selectionchange. // We cannot block bubbling selectionchange, so at least we // can prevent from falling into inf recursion caused by fix for #9699 // (see wysiwygarea plugin). // http://dev.ckeditor.com/ticket/10438#comment:13 var listener2 = root . getDocument ( ) . on ( 'selectionchange' , function ( evt ) { evt . cancel ( ) ; } , null , null , - 100 ) ; } doFocus && root . focus ( ) ; listener . removeListener ( ) ; listener2 && listener2 . removeListener ( ) ; }
Read the comments in selection constructor.
Read the comments in selection constructor .