Index: /CKEditor/branches/versions/3.4.x/_source/core/dom/range.js
===================================================================
--- /CKEditor/branches/versions/3.4.x/_source/core/dom/range.js	(revision 5747)
+++ /CKEditor/branches/versions/3.4.x/_source/core/dom/range.js	(revision 5748)
@@ -1638,22 +1638,32 @@
 
 		/**
-		 * Check whether current range is on the inner edge of the specified element.
-		 * @param {Number} checkType ( CKEDITOR.START | CKEDITOR.END ) The checking side.
+		 * Check whether a range boundary is at the inner boundary of a given
+		 * element.
 		 * @param {CKEDITOR.dom.element} element The target element to check.
+		 * @param {Number} checkType The boundary to check for both the range
+		 *		and the element. It can be CKEDITOR.START or CKEDITOR.END.
+		 * @returns {Boolean} "true" if the range boundary is at the inner
+		 *		boundary of the element.
 		 */
 		checkBoundaryOfElement : function( element, checkType )
 		{
+			var checkStart = ( checkType == CKEDITOR.START );
+
+			// Create a copy of this range, so we can manipulate it for our checks.
 			var walkerRange = this.clone();
+
+			// Collapse the range at the proper size.
+			walkerRange.collapse( checkStart );
+
 			// Expand the range to element boundary.
-			walkerRange[ checkType == CKEDITOR.START ?
-			 'setStartAt' : 'setEndAt' ]
-			 ( element, checkType == CKEDITOR.START ?
-			   CKEDITOR.POSITION_AFTER_START
-			   : CKEDITOR.POSITION_BEFORE_END );
-
+			walkerRange[ checkStart ? 'setStartAt' : 'setEndAt' ]
+			 ( element, checkStart ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END );
+
+			// Create the walker, which will check if we have anything useful
+			// in the range.
 			var walker = new CKEDITOR.dom.walker( walkerRange );
 			walker.evaluator = elementBoundaryEval;
-			return walker[ checkType == CKEDITOR.START ?
-				'checkBackward' : 'checkForward' ]();
+
+			return walker[ checkStart ? 'checkBackward' : 'checkForward' ]();
 		},
 
Index: /CKEditor/branches/versions/3.4.x/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.4.x/_source/plugins/styles/plugin.js	(revision 5747)
+++ /CKEditor/branches/versions/3.4.x/_source/plugins/styles/plugin.js	(revision 5748)
@@ -583,10 +583,12 @@
 				if ( this.checkElementRemovable( element ) )
 				{
-					var endOfElement = range.checkBoundaryOfElement( element, CKEDITOR.END ),
-							startOfElement = !endOfElement && range.checkBoundaryOfElement( element, CKEDITOR.START );
-					if ( startOfElement || endOfElement )
+					var isStart;
+
+					if ( range.collapsed && (
+						 range.checkBoundaryOfElement( element, CKEDITOR.END ) ||
+						 ( isStart = range.checkBoundaryOfElement( element, CKEDITOR.START ) ) ) )
 					{
 						boundaryElement = element;
-						boundaryElement.match = startOfElement ? 'start' : 'end';
+						boundaryElement.match = isStart ? 'start' : 'end';
 					}
 					else
Index: /CKEditor/branches/versions/3.4.x/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/branches/versions/3.4.x/_source/plugins/wysiwygarea/plugin.js	(revision 5747)
+++ /CKEditor/branches/versions/3.4.x/_source/plugins/wysiwygarea/plugin.js	(revision 5748)
@@ -46,6 +46,27 @@
 
 				var $sel = selection.getNative();
+
+				// Delete control selections to avoid IE bugs on pasteHTML.
 				if ( $sel.type == 'Control' )
 					$sel.clear();
+				else if  ( selection.getType() == CKEDITOR.SELECTION_TEXT )
+				{
+					// Due to IE bugs on handling contenteditable=false blocks
+					// (#6005), we need to make some checks and eventually
+					// delete the selection first.
+
+					var range = selection.getRanges()[0],
+						endContainer = range && range.endContainer;
+					
+					if ( endContainer &&
+ 						 endContainer.type == CKEDITOR.NODE_ELEMENT &&
+ 						 endContainer.getAttribute( 'contenteditable' ) == 'false' &&
+						 range.checkBoundaryOfElement( endContainer, CKEDITOR.END ) )
+					{
+						range.setEndAfter( range.endContainer );
+						range.deleteContents();
+					}
+				}
+
 				$sel.createRange().pasteHTML( data );
 
