Index: /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1226)
+++ /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1227)
@@ -254,17 +254,26 @@
 		var innerDoc = frmMain.contentWindow.document ;
 
-		var iFrameHeight ;
+		var iFrameHeight, iFrameWidth ;
 		if ( FCKBrowserInfo.IsIE )
-			iFrameHeight = innerDoc.body.offsetHeight ;
+		{
+			iFrameHeight = innerDoc.documentElement.offsetHeight ;
+			iFrameWidth = innerDoc.documentElement.offsetWidth ;
+		}
 		else
+		{
 			iFrameHeight = frmMain.contentWindow.innerHeight ;
-
-		var iInnerHeight = innerDoc.body.scrollHeight ;
+			iFrameWidth = frmMain.contentWindow.innerWidth ;
+		}
+
+		var iInnerHeight = innerDoc.compatMode == 'BackCompat' ? innerDoc.body.scrollHeight : innerDoc.documentElement.scrollHeight ;
+		var iInnerWidth = innerDoc.compatMode == 'BackCompat' ? innerDoc.body.scrollWidth : innerDoc.documentElement.scrollWidth ;
 		frmMain.style.height = iInnerHeight + 'px' ;
-
-		var iDiff = iInnerHeight - iFrameHeight ;
-
-		if ( iDiff > 0 )
-			ResizeDialog( dialogFrame.offsetWidth, dialogFrame.offsetHeight + iDiff ) ;
+		frmMain.style.width = iInnerWidth + 'px' ;
+
+		var iDeltaHeight = Math.max( iInnerHeight - iFrameHeight, 0 ) ;
+		var iDeltaWidth = Math.max( iInnerWidth - iFrameWidth, 0 ) ;
+
+		if ( iDeltaHeight > 0 || iDeltaWidth > 0 )
+			ResizeDialog( dialogFrame.offsetWidth + iDeltaWidth, dialogFrame.offsetHeight + iDeltaHeight ) ;
 	}
 	RefreshContainerSize() ;
