Index: CKEditor/branches/versions/3.3.x/CHANGES.html
===================================================================
--- CKEditor/branches/versions/3.3.x/CHANGES.html	(revision 5521)
+++ CKEditor/branches/versions/3.3.x/CHANGES.html	(revision 5524)
@@ -68,6 +68,4 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5559">#5559</a> : [IE] The first call of CKEDITOR.editor::setData is affected by iframe cache when loading wysiwyg mode.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5567">#5567</a> : [IE] Remove inline styles in some case doesn't join identical siblings.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/4836">#4836</a> : Using SCAYT result in fragile elements when applying inline styles.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5425">#5425</a> : [Opera] Disable SCAYT plugin for Opera browser.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5450">#5450</a> : [FireFox] Press enter on 'replace' button result wrong.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5121">#5121</a> : Recognizes the &lt;br /&gt; tag as a separator when apply block styles in enterMode=BR.</li>
@@ -85,8 +83,6 @@
 		<li><a href="http://dev.fckeditor.net/ticket/4734">#4734</a> : Font size resets when font name is changed in an empty numbered list.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5237">#5237</a> : English text in dialogs' title is flipped when using RTL language.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5632">#5632</a> : SCAYT word marker is not visible on text with background-color set.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/3257">#3257</a> : Create list doesn't keep blocks as headings.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5111">#5111</a> : [Firefox] JAWS doesn't respect PC cursor mode (application role) on toolbar.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/4125">#4125</a> : Remove Format command incorrectly removes SCAYT word markers.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5530">#5530</a> : Page break for printing can't be removed with undo.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5381">#5381</a> : Unable to place cursor between two paragraphs in body.</li>
@@ -94,11 +90,8 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5623">#5623</a> : [Firefox] Apply style that edges another inline style result incorrect.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5586">#5586</a> : [Firefox] Maximize the second editor ruins fullscreen mode.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5671">#5671</a> : SCAYT bookstrap script could be added multiple times unnecessarily.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5617">#5617</a> : Html filter system does not allow two 'text' filter rules.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5663">#5663</a> : General memory clean up after destroying last instance.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5673">#5673</a> : [Firefox] Tab key have to press twice to focus the editor.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5461">#5461</a> : [IE] Fix Paste from Word dialog doesn't accept imput problem.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5573">#5573</a> : SCAYT move cursor position after insert element into marked word text.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5546">#5546</a> : SCAYT interferes with undo/redo commands.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5676">#5676</a> : Make color buttons use RRGGBB instead of RGB for better compatibility with IE.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/4948">#4948</a> : [Safari] Select the first/last cell of table to open context menu may lead to undetected table.</li>
@@ -106,7 +99,19 @@
 		<li><a href="http://dev.fckeditor.net/ticket/5667">#5667</a> : Pasting in a RTL page content causes shows up the horizontal scrollbar.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5688">#5688</a> : Duplicate ids are used in dialog definition.</li>
-		<li><a href="http://dev.fckeditor.net/ticket/5570">#5570</a> : [IE] First enabling SCAYT blind cursor in editor.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5719">#5719</a> : [IE] 'change' dialog event should not be triggered when dialog is already closed.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5746">#5746</a> : [Firefox] Form elements (input/textarea) because editable and cause problem in wysiwyg mode.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/5747">#5747</a> : [IE] Error thrown when IE input field editing mode is turned on.</li>
+		<li>SCAYT plugin related:<ul>
+			<li><a href="http://dev.fckeditor.net/ticket/4836">#4836</a> : Using SCAYT result in fragile elements when applying inline styles.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5425">#5425</a> : [Opera] Disable SCAYT plugin for Opera browser.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5632">#5632</a> : SCAYT word marker is not visible on text with background-color set.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/4125">#4125</a> : Remove Format command incorrectly removes SCAYT word markers.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5671">#5671</a> : SCAYT bookstrap script could be added multiple times unnecessarily.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5573">#5573</a> : SCAYT move cursor position after insert element into marked word text.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5546">#5546</a> : SCAYT interferes with undo/redo commands.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5570">#5570</a> : [IE] First enabling SCAYT blind cursor in editor.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5741">#5741</a> : Enable SCAYT cause error in multiple editor instances.</li>
+			<li><a href="http://dev.fckeditor.net/ticket/5744">#5744</a> : Remove editor with SCAYT enabled in source mode throws error.</li>
+		</ul></li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.fckeditor.net/ticket/5432">#5432</a> : Dutch;</li>
Index: CKEditor/branches/versions/3.3.x/_source/plugins/scayt/plugin.js
===================================================================
--- CKEditor/branches/versions/3.3.x/_source/plugins/scayt/plugin.js	(revision 5521)
+++ CKEditor/branches/versions/3.3.x/_source/plugins/scayt/plugin.js	(revision 5524)
@@ -12,8 +12,6 @@
 {
 	var commandName 	= 'scaytcheck',
-		openPage		= '',
-		scayt_paused	= null,
-		scayt_control_id = null;
-
+		openPage		= '';
+		
 	// Checks if a value exists in an array
 	function in_array(needle, haystack)
@@ -56,6 +54,6 @@
 
 					// Call scayt_control.focus when SCAYT loaded
-					// and only if editor has focus
-					if ( editor.focusManager.hasFocus )
+					// and only if editor has focus and scayt control creates at first time (#5720)
+					if ( editor.focusManager.hasFocus && !plugin.isControlRestored( editor ) )
 						this.focus();
 
@@ -77,6 +75,6 @@
 			}
 			// needs for restoring a specific scayt control settings
-			if ( scayt_control_id )
-				oParams.id = scayt_control_id;
+			if ( plugin.getControlId(editor) )
+				oParams.id = plugin.getControlId(editor);
 
 			var scayt_control = new window.scayt( oParams );
@@ -108,5 +106,5 @@
 			plugin.uiTabs = fTabs;
 			try {
-				scayt_control.setDisabled( scayt_paused === false );
+				scayt_control.setDisabled( plugin.isPaused( editor ) === false );
 			} catch (e) {}
 
@@ -140,11 +138,14 @@
 					if ( scayt_instance )
 					{
-						scayt_paused = scayt_instance.paused = !scayt_instance.disabled;
+						plugin.setPaused( editor, !scayt_instance.disabled );
 						// store a control id for restore a specific scayt control settings
-						scayt_control_id = scayt_instance.id;
+						plugin.setControlId( editor, scayt_instance.id );
 						scayt_instance.destroy( true );
 						delete plugin.instances[ editor.name ];
 					}
 				}
+				// Catch on source mode switch off (#5720)
+				else if ( ev.data.name == 'source'  && editor.mode == 'source' )
+					plugin.markControlRestore( editor )
 			});
 
@@ -162,7 +163,12 @@
 				var editor = ev.editor,
 					scayt_instance = plugin.getScayt( editor );
+
+				// SCAYT instance might already get destroyed by mode switch (#5744).
+				if ( !scayt_instance )
+					return;
+
 				delete plugin.instances[ editor.name ];
 				// store a control id for restore a specific scayt control settings
-				scayt_control_id = scayt_instance.id;
+				plugin.setControlId( editor, scayt_instance.id );
 				scayt_instance.destroy( true );
 			});
@@ -262,6 +268,7 @@
 				if ( scayt_instance && plugin.isScaytReady( this.editor ) )
 				{
-					this.contents = scayt_instance.reset( thisContents );
-					otherImage.contents = scayt_instance.reset( otherContents );
+					// scayt::reset might return value undefined. (#5742)
+					this.contents = scayt_instance.reset( thisContents ) || '';
+					otherImage.contents = scayt_instance.reset( otherContents ) || '';
 				}
 				
@@ -277,9 +284,62 @@
 			createInstance();
 	};
-
-	CKEDITOR.plugins.scayt =
+	
+CKEDITOR.plugins.scayt =
 	{
 		engineLoaded : false,
 		instances : {},
+		// Data storage for SCAYT control, based on editor instances
+		controlInfo : {},
+		setControlInfo : function( editor, o )
+		{
+			if ( editor && editor.name && typeof ( this.controlInfo[ editor.name ] ) != 'object' )
+				this.controlInfo[ editor.name ] = {};
+			
+			for ( var infoOpt in o )
+				this.controlInfo[ editor.name ][ infoOpt ] = o[ infoOpt ];
+		},
+		isControlRestored : function ( editor )
+		{
+			if ( editor &&
+					editor.name &&
+					this.controlInfo[ editor.name ] )
+			{
+				return this.controlInfo[ editor.name ].restored ;
+			}
+			return false;
+		},
+		markControlRestore : function ( editor )
+		{
+			this.setControlInfo( editor,{ restored:true } );
+		},
+		setControlId: function (editor, id)
+		{
+			this.setControlInfo( editor,{ id:id } );
+		},
+		getControlId: function (editor)
+		{
+			if ( editor &&
+					editor.name &&
+					this.controlInfo[ editor.name ] &&
+					this.controlInfo[ editor.name ].id )
+			{
+				return this.controlInfo[ editor.name ].id
+			}
+			return null;
+		},
+		setPaused: function ( editor , bool )
+		{
+			this.setControlInfo( editor,{ paused:bool } );
+		},
+		isPaused: function (editor)
+		{
+			if ( editor &&
+					editor.name && 
+					this.controlInfo[editor.name] )
+			{
+				return this.controlInfo[editor.name].paused ;
+			}
+			return undefined;
+		},
 		getScayt : function( editor )
 		{
@@ -306,5 +366,5 @@
 			else if ( this.engineLoaded == -1 )			// We are waiting.
 				return CKEDITOR.on( 'scaytReady', function(){ onEngineLoad.apply( editor ); } );	// Use function(){} to avoid rejection as duplicate.
-
+			
 			CKEDITOR.on( 'scaytReady', onEngineLoad, editor );
 			CKEDITOR.on( 'scaytReady', function()
@@ -740,5 +800,5 @@
 
 			editor.addRemoveFormatFilter && editor.addRemoveFormatFilter( scaytFilter );
-
+			
 		}
 	});
Index: CKEditor/branches/versions/3.3.x/_source/plugins/selection/plugin.js
===================================================================
--- CKEditor/branches/versions/3.3.x/_source/plugins/selection/plugin.js	(revision 5521)
+++ CKEditor/branches/versions/3.3.x/_source/plugins/selection/plugin.js	(revision 5524)
@@ -232,4 +232,13 @@
 										return;
 									}
+								}
+
+								// Avoid saving selection from within text input. (#5747)
+								var parentTag;
+								if ( nativeSel.type == 'Text'
+									&& ( parentTag = nativeSel.createRange().parentElement().nodeName.toLowerCase() )
+									&& parentTag in { input: 1, textarea : 1 } )
+								{
+									return;
 								}
 
