Index: CKEditor/trunk/CHANGES.html
===================================================================
--- CKEditor/trunk/CHANGES.html	(revision 7241)
+++ CKEditor/trunk/CHANGES.html	(revision 7242)
@@ -78,4 +78,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/7153">#7153</a> : Fail to load dev version of the editor after the window is loaded.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/8246">#8246</a> : Bad editing performance on certain document content.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7912">#7912</a> : Cursor trapped in invisible element after enter key.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/8128">#8128</a> : Italian;</li>
Index: CKEditor/trunk/_source/core/dom/element.js
===================================================================
--- CKEditor/trunk/_source/core/dom/element.js	(revision 7241)
+++ CKEditor/trunk/_source/core/dom/element.js	(revision 7242)
@@ -722,5 +722,5 @@
 		isEditable : function()
 		{
-			if ( this.isReadOnly() )
+			if ( this.isReadOnly() || !this.isVisible() )
 				return false;
 
@@ -782,5 +782,5 @@
 		isVisible : function()
 		{
-			var isVisible = !!this.$.offsetHeight && this.getComputedStyle( 'visibility' ) != 'hidden',
+			var isVisible = ( this.$.offsetHeight || this.$.offsetWidth ) && this.getComputedStyle( 'visibility' ) != 'hidden',
 				elementWindow,
 				elementWindowFrame;
@@ -799,5 +799,5 @@
 			}
 
-			return isVisible;
+			return !!isVisible;
 		},
 
Index: CKEditor/trunk/_source/core/dom/range.js
===================================================================
--- CKEditor/trunk/_source/core/dom/range.js	(revision 7241)
+++ CKEditor/trunk/_source/core/dom/range.js	(revision 7242)
@@ -1921,45 +1921,52 @@
 		moveToElementEditablePosition : function( el, isMoveToEnd )
 		{
-			var isEditable;
-
-			// Empty elements are rejected.
-			if ( CKEDITOR.dtd.$empty[ el.getName() ] )
-				return false;
-
-			while ( el && el.type == CKEDITOR.NODE_ELEMENT )
-			{
-				isEditable = el.isEditable();
-
-				// If an editable element is found, move inside it.
-				if ( isEditable )
-					this.moveToPosition( el, isMoveToEnd ?
-					                         CKEDITOR.POSITION_BEFORE_END :
-					                         CKEDITOR.POSITION_AFTER_START );
-				// Stop immediately if we've found a non editable inline element (e.g <img>).
-				else if ( CKEDITOR.dtd.$inline[ el.getName() ] )
+			function nextDFS( node, childOnly )
+			{
+				var next;
+
+				if ( node.type == CKEDITOR.NODE_ELEMENT
+						&& !node.isReadOnly()
+						&& node.isVisible()
+						&& !CKEDITOR.dtd.$nonEditable[ node.getName() ] )
+				{
+					next = node[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval );
+				}
+
+				if ( !childOnly && !next )
+					next = node[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval );
+
+				return next;
+			}
+			
+			var found = 0;
+
+			while ( el )
+			{
+				// Stop immediately if we've found a text node.
+				if ( el.type == CKEDITOR.NODE_TEXT )
 				{
 					this.moveToPosition( el, isMoveToEnd ?
 					                         CKEDITOR.POSITION_AFTER_END :
 					                         CKEDITOR.POSITION_BEFORE_START );
-					return true;
-				}
-
-				// Non-editable non-inline elements are to be bypassed, getting the next one.
-				if ( CKEDITOR.dtd.$empty[ el.getName() ] )
-					el = el[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval );
-				else
-					el = el[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval );
-
-				// Stop immediately if we've found a text node.
-				if ( el && el.type == CKEDITOR.NODE_TEXT )
-				{
-					this.moveToPosition( el, isMoveToEnd ?
-					                         CKEDITOR.POSITION_AFTER_END :
-					                         CKEDITOR.POSITION_BEFORE_START );
-					return true;
-				}
-			}
-
-			return isEditable;
+					found = 1;
+					break;
+				}
+
+				// If an editable element is found, move inside it, but not stop the searching.
+				if ( el.type == CKEDITOR.NODE_ELEMENT )
+				{
+					if ( el.isEditable() )
+					{
+						this.moveToPosition( el, isMoveToEnd ?
+												 CKEDITOR.POSITION_BEFORE_END :
+												 CKEDITOR.POSITION_AFTER_START );
+						found = 1;
+					}
+				}
+
+				el = nextDFS( el, found );
+			}
+
+			return !!found;
 		},
 
