Index: /FCKeditor/trunk/editor/_source/internals/fck_gecko.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fck_gecko.js	(revision 922)
+++ /FCKeditor/trunk/editor/_source/internals/fck_gecko.js	(revision 923)
@@ -78,5 +78,5 @@
 				return ;
 		}
-		
+
 		var blockEmptyStop = function( node )
 		{
@@ -105,6 +105,6 @@
 			// only perform the patched behavior if we're in an <a> tag, or the End key is pressed.
 			var parentTag = node.parentNode.tagName.toLowerCase() ;
-			if ( ! (  parentTag == 'a' || 
-					( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] ) 
+			if ( ! (  parentTag == 'a' ||
+					( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] )
 					  && keyCode == 35 ) ) )
 				return ;
@@ -130,5 +130,5 @@
 					return ;
 
-				// now we want to get out of our current parent node, adopt the next parent, and move the caret to 
+				// now we want to get out of our current parent node, adopt the next parent, and move the caret to
 				// the appropriate text node under our new parent.
 				// our new parent might be our current parent's siblings if we are lucky.
@@ -139,13 +139,13 @@
 			{
 				// no suitable next siblings under our grandparent! what to do next?
-				while ( node.parentNode 
+				while ( node.parentNode
 					&& node.parentNode != FCK.EditorDocument.body
 					&& node.parentNode != FCK.EditorDocument.documentElement
-					&& node == node.parentNode.lastChild 
+					&& node == node.parentNode.lastChild
 					&& ( ! FCKListsLib.BlockElements[node.parentNode.tagName.toLowerCase()] ) )
 					node = node.parentNode ;
-			
-
-				if ( FCKListsLib.BlockElements[ parentTag ] 
+
+
+				if ( FCKListsLib.BlockElements[ parentTag ]
 						|| FCKListsLib.EmptyElements[ parentTag ]
 						|| node == FCK.EditorDocument.body )
@@ -161,5 +161,5 @@
 					var stopNode = node.nextSibling ;
 
-					// find out the next block/empty element at our grandparent, we'll 
+					// find out the next block/empty element at our grandparent, we'll
 					// move the caret just before it.
 					while ( stopNode )
@@ -170,5 +170,5 @@
 							continue ;
 						}
-						
+
 						var stopTag = stopNode.tagName.toLowerCase() ;
 						if ( FCKListsLib.BlockElements[stopTag] || FCKListsLib.EmptyElements[stopTag] )
@@ -177,5 +177,5 @@
 					}
 
-					// note that the dummy marker below is NEEDED, otherwise the caret's behavior will 
+					// note that the dummy marker below is NEEDED, otherwise the caret's behavior will
 					// be broken in Gecko.
 					var marker = FCK.EditorDocument.createTextNode( '' ) ;
@@ -193,5 +193,5 @@
 			FCK.Events.FireEvent( "OnSelectionChange" ) ;
 		}
-		
+
 		setTimeout( moveCursor, 1 ) ;
 	}
@@ -254,4 +254,28 @@
 		this.EditorDocument.addEventListener( 'dragover', cancelHandler, true ) ;
 		this.EditorDocument.addEventListener( 'drop', this._ExecDrop, true ) ;
+		this.EditorDocument.addEventListener( 'mousedown',
+			function( ev )
+			{
+				var element = ev.srcElement ;
+
+				if ( element.nodeName.IEquals( 'IMG', 'HR', 'INPUT', 'TEXTAREA', 'SELECT' ) )
+				{
+					FCKSelection.SelectNode( element ) ;
+				}
+			}, true ) ;
+
+		this.EditorDocument.addEventListener( 'mouseup',
+			function( ev )
+			{
+				if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
+					ev.preventDefault()
+			}, true ) ;
+
+		this.EditorDocument.addEventListener( 'click',
+			function( ev )
+			{
+				if ( ev.srcElement.nodeName.IEquals( 'INPUT', 'TEXTAREA', 'SELECT' ) )
+					ev.preventDefault()
+			}, true ) ;
 	}
 
@@ -318,7 +342,7 @@
 			{
 				if ( FCKBrowserInfo.IsSafari )		// Bug #50 : force the paste dialog for Safari.
-					throw new Error("Forced dialog"); 
-				if ( FCK.Paste() ) 
-					FCK.ExecuteNamedCommand( 'Paste', null, true ) ; 
+					throw new Error("Forced dialog");
+				if ( FCK.Paste() )
+					FCK.ExecuteNamedCommand( 'Paste', null, true ) ;
 			}
 			catch (e)	{ FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.Paste, 'dialog/fck_paste.html', 400, 330, 'Security' ) ; }
Index: /FCKeditor/trunk/editor/_source/internals/fckselection_gecko.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckselection_gecko.js	(revision 922)
+++ /FCKeditor/trunk/editor/_source/internals/fckselection_gecko.js	(revision 923)
@@ -52,19 +52,25 @@
 FCKSelection.GetSelectedElement = function()
 {
-	if ( this.GetType() == 'Control' )
-	{
-		var oSel = FCK.EditorWindow.getSelection() ;
-
-		// For Safari, the anchor node for a control selection is the control
-		// itself, which seams logic. FF and Opera use the parent as the anchor
-		// node, pointing to the control with the offset.
+	var selectedElement = null ;
+
+	var selection = FCK.EditorWindow.getSelection() ;
+
+	if ( selection && selection.anchorNode && selection.anchorNode.nodeType == 1 )
+	{
+		// This one is good for all browsers, expect Safari Mac.
+		selectedElement = selection.anchorNode.childNodes[ selection.anchorOffset ] ;
+
+		// For Safari (Mac only), the anchor node for a control selection is
+		// the control itself, which seams logic. FF and Opera use the parent
+		// as the anchor node, pointing to the control with the offset.
 		// As FF created the selection "standard", Safari would do better by
 		// following their steps.
-		if ( FCKBrowserInfo.IsSafari )
-			return oSel.anchorNode ;
-		else
-			return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ;
-	}
-	return null ;
+		if ( !selectedElement )
+			selectedElement = selection.anchorNode ;
+		else if ( selectedElement.nodeType != 1 )
+			return null ;
+	}
+
+	return selectedElement ;
 }
 
