diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index fe02b825356..71769904222 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1019,6 +1019,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { + DO_GLOBAL_REFLOW_COUNT("nsComboboxControlFrame", aReflowState.reason); + aStatus = NS_FRAME_COMPLETE; REFLOW_COUNTER_REQUEST(); @@ -1860,7 +1862,12 @@ nsComboboxControlFrame::SelectionChanged() REFLOW_DEBUG_MSG3("**** SelectionChanged Old[%s] New[%s]\n", value.ToNewCString(), mTextStr.ToNewCString()); } if (shouldSetValue) { - rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + if (mTextStr.Length() == 0) { + nsAutoString space(" "); + rv = mDisplayContent->SetText(space.GetUnicode(), space.Length(), PR_TRUE); + } else { + rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + } nsFrameState state; //mTextFrame->GetFrameState(&state); //state |= NS_FRAME_IS_DIRTY; diff --git a/layout/forms/nsComboboxControlFrame.h b/layout/forms/nsComboboxControlFrame.h index a2f772dbbf0..8fa32a1ff6f 100644 --- a/layout/forms/nsComboboxControlFrame.h +++ b/layout/forms/nsComboboxControlFrame.h @@ -28,8 +28,8 @@ #endif #ifdef DEBUG_rods -#define DO_REFLOW_DEBUG -#define DO_REFLOW_COUNTER +//#define DO_REFLOW_DEBUG +//#define DO_REFLOW_COUNTER //#define DO_UNCONSTRAINED_CHECK //#define DO_PIXELS //#define DO_NEW_REFLOW diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index fe02b825356..71769904222 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1019,6 +1019,8 @@ nsComboboxControlFrame::Reflow(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { + DO_GLOBAL_REFLOW_COUNT("nsComboboxControlFrame", aReflowState.reason); + aStatus = NS_FRAME_COMPLETE; REFLOW_COUNTER_REQUEST(); @@ -1860,7 +1862,12 @@ nsComboboxControlFrame::SelectionChanged() REFLOW_DEBUG_MSG3("**** SelectionChanged Old[%s] New[%s]\n", value.ToNewCString(), mTextStr.ToNewCString()); } if (shouldSetValue) { - rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + if (mTextStr.Length() == 0) { + nsAutoString space(" "); + rv = mDisplayContent->SetText(space.GetUnicode(), space.Length(), PR_TRUE); + } else { + rv = mDisplayContent->SetText(mTextStr.GetUnicode(), mTextStr.Length(), PR_TRUE); + } nsFrameState state; //mTextFrame->GetFrameState(&state); //state |= NS_FRAME_IS_DIRTY; diff --git a/layout/html/forms/src/nsComboboxControlFrame.h b/layout/html/forms/src/nsComboboxControlFrame.h index a2f772dbbf0..8fa32a1ff6f 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.h +++ b/layout/html/forms/src/nsComboboxControlFrame.h @@ -28,8 +28,8 @@ #endif #ifdef DEBUG_rods -#define DO_REFLOW_DEBUG -#define DO_REFLOW_COUNTER +//#define DO_REFLOW_DEBUG +//#define DO_REFLOW_COUNTER //#define DO_UNCONSTRAINED_CHECK //#define DO_PIXELS //#define DO_NEW_REFLOW