diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 7b50ce5ae2a0809718be6be93b30a165ff11af59..0dd61568f9e0e90dff9f970511d9fe85647fc56e 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -58,11 +58,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
   , mSpeakingIndicator(NULL)
   , mChatHistory(NULL)
   , mInputEditor(NULL)
-  , mInputEditorTopPad(0)
+  , mInputEditorPad(0)
   , mRefreshTimer(new LLTimer())
   , mIsHostAttached(false)
   , mHasVisibleBeenInitialized(false)
   , mIsParticipantListExpanded(true)
+  , mChatLayoutPanel(NULL)
 {
     setAutoFocus(FALSE);
 	mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
@@ -237,12 +238,15 @@ BOOL LLFloaterIMSessionTab::postBuild()
 	mChatHistory = getChild<LLChatHistory>("chat_history");
 
 	mInputEditor = getChild<LLChatEntry>("chat_editor");
-	mInputEditor->setTextExpandedCallback(boost::bind(&LLFloaterIMSessionTab::reshapeChatHistory, this));
+
+	mChatLayoutPanel = getChild<LLLayoutPanel>("chat_layout_panel");
+	
+	mInputEditor->setTextExpandedCallback(boost::bind(&LLFloaterIMSessionTab::reshapeChatLayoutPanel, this));
 	mInputEditor->setCommitOnFocusLost( FALSE );
 	mInputEditor->setPassDelete(TRUE);
 	mInputEditor->setFont(LLViewerChat::getChatFont());
 
-	mInputEditorTopPad = mChatHistory->getRect().mBottom - mInputEditor->getRect().mTop;
+	mInputEditorPad = mChatLayoutPanel->getRect().getHeight() - mInputEditor->getRect().getHeight();
 
 	setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
 
@@ -708,15 +712,11 @@ void LLFloaterIMSessionTab::forceReshape()
 }
 
 
-void LLFloaterIMSessionTab::reshapeChatHistory()
+void LLFloaterIMSessionTab::reshapeChatLayoutPanel()
 {
-	LLRect chat_rect  = mChatHistory->getRect();
+	LLRect chat_layout_panel_rect = mChatLayoutPanel->getRect();
 	LLRect input_rect = mInputEditor->getRect();
-
-	int delta_height = chat_rect.mBottom - (input_rect.mTop + mInputEditorTopPad);
-
-	chat_rect.setLeftTopAndSize(chat_rect.mLeft, chat_rect.mTop, chat_rect.getWidth(), chat_rect.getHeight() + delta_height);
-	mChatHistory->setShape(chat_rect);
+	mChatLayoutPanel->reshape(chat_layout_panel_rect.getWidth(), input_rect.getHeight() + mInputEditorPad, FALSE);
 }
 
 void LLFloaterIMSessionTab::showTranslationCheckbox(BOOL show)
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index f22e2b57442b2b0f3b32a5ac0c6bbbcda23e128f..e9393c53368fd7f0db584596b02bfc657d370491 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -168,7 +168,8 @@ class LLFloaterIMSessionTab
     LLOutputMonitorCtrl* mSpeakingIndicator;
 	LLChatHistory* mChatHistory;
 	LLChatEntry* mInputEditor;
-	int mInputEditorTopPad; // padding between input field and chat history
+	LLLayoutPanel * mChatLayoutPanel;
+	int mInputEditorPad; // padding between input field and chat history
 
 	LLButton* mExpandCollapseLineBtn;
 	LLButton* mExpandCollapseBtn;
@@ -195,7 +196,7 @@ class LLFloaterIMSessionTab
 	 * and avoid overlapping, since input chat field can be vertically expanded.
 	 * Implementation: chat history bottom "follows" top+top_pad of input chat field
 	 */
-	void reshapeChatHistory();
+	void reshapeChatLayoutPanel();
 
 	bool checkIfTornOff();
     bool mIsHostAttached;