Index: /CKEditor/trunk/_samples/replacebyclass.html
===================================================================
--- /CKEditor/trunk/_samples/replacebyclass.html	(revision 7388)
+++ /CKEditor/trunk/_samples/replacebyclass.html	(revision 7389)
@@ -55,4 +55,284 @@
 		</p>
 	</form>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
+	<div class="description">
+	<p>
+		This sample shows how to automatically replace all <code>&lt;textarea&gt;</code> elements
+		of a given class with a CKEditor instance.
+	</p>
+	<p>
+		To replace a <code>&lt;textarea&gt;</code> element, simply assign it the <code>ckeditor</code>
+		class, as in the code below:
+	</p>
+	<pre class="samples">&lt;textarea <strong>class="ckeditor</strong>" name="editor1"&gt;&lt;/textarea&gt;</pre>
+	<p>
+		Note that other <code>&lt;textarea&gt;</code> attributes (like <code>id</code> or <code>name</code>) need to be adjusted to your document.
+	</p>
+	</div>
 	<div id="footer">
 		<hr />
Index: /CKEditor/trunk/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 7388)
+++ /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 7389)
@@ -303,20 +303,22 @@
 								saveEnabled = 0;
 								restoreEnabled = 1;
+
 							});
 
-						// IE before version 8 will leave cursor blinking inside the document after
-						// editor blurred unless we clean up the selection. (#4716)
-						if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 )
-						{
-							editor.on( 'blur', function( evt )
-							{
-								// Try/Catch to avoid errors if the editor is hidden. (#6375)
-								try
-								{
-									editor.document && editor.document.$.selection.empty();
-								}
-								catch (e) {}
-							});
-						}
+						// [IE] Iframe will still keep the selection when blurred, if
+						// focus is moved onto a non-editing host, e.g. link or button, but
+						// it becomes a problem for the object type selection, since the resizer
+						// handler attached on it will mark other part of the UI, especially
+						// for the dialog. (#8157)
+						// [IE<8] Even worse For old IEs, the cursor will not vanish even if
+						// the selection has been moved to another text input in some cases. (#4716)
+						//
+						// Now the range restore is disabled, so we simply force IE to clean
+						// up the selection before blur.
+						CKEDITOR.env.ie && doc.getWindow().on( 'blur', function()
+						{
+							// Error proof when the editor is not visible. (#6375)
+							try{ doc.$.selection.empty(); } catch ( er){}
+						});
 
 						// Listening on document element ensures that
