diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 9030326ce319..90acd8de6ecd 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -496,8 +496,15 @@ nsComboboxControlFrame::GetHorizontalInsidePadding(nsIPresContext* aPresContext, void nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { - mFocused = aOn?this:nsnull; - // Thiis is needed on a temporary basis. It causes the focus + if (aOn) { + mFocused = this; + } else { + mFocused = nsnull; + if (mDroppedDown) { + ToggleList(mPresContext); + } + } + // This is needed on a temporary basis. It causes the focus // rect to be drawn. This is much faster than ReResolvingStyle // Bug 32920 Invalidate(mPresContext, nsRect(0,0,mRect.width,mRect.height), PR_TRUE); diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index 9030326ce319..90acd8de6ecd 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -496,8 +496,15 @@ nsComboboxControlFrame::GetHorizontalInsidePadding(nsIPresContext* aPresContext, void nsComboboxControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) { - mFocused = aOn?this:nsnull; - // Thiis is needed on a temporary basis. It causes the focus + if (aOn) { + mFocused = this; + } else { + mFocused = nsnull; + if (mDroppedDown) { + ToggleList(mPresContext); + } + } + // This is needed on a temporary basis. It causes the focus // rect to be drawn. This is much faster than ReResolvingStyle // Bug 32920 Invalidate(mPresContext, nsRect(0,0,mRect.width,mRect.height), PR_TRUE);