зеркало из https://github.com/mozilla/gecko-dev.git
Don't cut off the right-hand side of empty comboboxes. Bug 364510, r+sr=dbaron
This commit is contained in:
Родитель
0c312f39a8
Коммит
bf4922535e
|
@ -586,6 +586,22 @@ nsComboboxControlFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
|
|||
result = 0;
|
||||
}
|
||||
|
||||
// It's also possible that the pref width of our dropdown is less than that
|
||||
// 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(GetPresContext(), aRenderingContext);
|
||||
nscoord displayResult =
|
||||
scrollable->GetDesiredScrollbarSizes(&bls).LeftRight() +
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext, mDisplayFrame,
|
||||
nsLayoutUtils::PREF_WIDTH);
|
||||
|
||||
result = PR_MAX(result, displayResult);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче