From d12acf85cfeeff2699f1079dc1de5bf777444887 Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 23 May 2007 12:16:27 -0700 Subject: [PATCH] don't add scrollbar width to getPrefWidth in nsComboboxControlFrame if the themed widget has set the internal button width to 0. b=381669 r/sr=roc --- layout/forms/nsComboboxControlFrame.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 3d32f3c93719..97f6fe1f3ee7 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -593,15 +593,16 @@ nsComboboxControlFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext) // of our display frame plus a scrollbar. This can happen, eg, if the // dropdown is empty. if (NS_LIKELY(mListControlFrame && mDisplayFrame)) { - nsIScrollableFrame* scrollable; - CallQueryInterface(mListControlFrame, &scrollable); - NS_ASSERTION(scrollable, "List must be a scrollable frame"); - nsBoxLayoutState bls(PresContext(), aRenderingContext); - nscoord displayResult = - scrollable->GetDesiredScrollbarSizes(&bls).LeftRight() + - nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mDisplayFrame, - nsLayoutUtils::PREF_WIDTH); - + nscoord displayResult = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mDisplayFrame, + nsLayoutUtils::PREF_WIDTH); + nsPresContext *presContext = PresContext(); + if (!IsThemed() || presContext->GetTheme()->ThemeNeedsComboboxDropmarker()) { + nsIScrollableFrame* scrollable; + CallQueryInterface(mListControlFrame, &scrollable); + NS_ASSERTION(scrollable, "List must be a scrollable frame"); + nsBoxLayoutState bls(presContext, aRenderingContext); + displayResult += scrollable->GetDesiredScrollbarSizes(&bls).LeftRight(); + } result = PR_MAX(result, displayResult); }