Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 7017)
+++ /CKEditor/trunk/CHANGES.html	(revision 7018)
@@ -1,3 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!--
 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
@@ -96,4 +96,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/7915">#7915</a> : [IE] Editing iframe height value missing from the Iframe dialog.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7953">#7953</a> : [IE] Text selection lost after open native context menu.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/7984">#7984</a> : The autogrow plugin breaks in quirks mode content document.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/7834">#7834</a> : Dutch;</li>
Index: /CKEditor/trunk/_source/plugins/autogrow/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/autogrow/plugin.js	(revision 7017)
+++ /CKEditor/trunk/_source/plugins/autogrow/plugin.js	(revision 7018)
@@ -13,5 +13,5 @@
 		init : function( editor )
 		{
-			var lastContentHeight;
+			var contentMargin = 0;
 			var resizeEditor = function( editor )
 			{
@@ -26,12 +26,12 @@
 					newHeight;
 
-				var delta =
-						// Delta height by checking scrollHeight.
-						( CKEDITOR.env.ie && CKEDITOR.env.quirks ? body.scrollHeight - body.clientHeight
-								: htmlElement.scrollHeight - ( htmlElement.clientHeight || htmlElement.offsetHeight ) )
-						// Negative scrollHeight (content reduced) is not supported in some browsers, figure it out by watching over the content size.
-						|| ( body.clientHeight < lastContentHeight ? body.clientHeight - lastContentHeight : 0 );
+				// Quirks mode overflows body, standards oveflows document element.
+				var delta,
+					scrollable = doc.$.compatMode == 'BackCompat' ? body : htmlElement,
+					increase = scrollable.scrollHeight - scrollable.clientHeight,
+					decrease = body.offsetHeight - scrollable.scrollHeight + contentMargin;
 
-				if ( delta )
+				// Delta height from either increasing or decreasing.
+				if ( delta  =  increase ||decrease || 0 )
 				{
 					newHeight = currentHeight + delta;
@@ -50,8 +50,9 @@
 						resizeable.setStyle( 'height', newHeight + 'px' );
 						editor.fire( 'resize' );
+						// Calculate and record now the margin between the actual content size and page size.
+						setTimeout( function() { contentMargin = scrollable.scrollHeight - body.offsetHeight; }, 0 );
+
 					}
 				}
-
-				lastContentHeight = body.clientHeight;
 			};
 
@@ -68,6 +69,6 @@
 						setTimeout( function(){ resizeEditor( evt.editor ); }, 100 );
 					}
-				});
-			}
+			});
+		}
 		}
 	});
