Bug 384491, remove assertion when <xul:listboxbody style='overflow: hidden' />, r+sr=roc

This commit is contained in:
Olli.Pettay@helsinki.fi 2007-06-21 02:35:41 -07:00
parent 32e1431af7
commit f0c8d4f1c5

View File

@ -237,23 +237,18 @@ nsListBoxBodyFrame::Init(nsIContent* aContent,
nsIFrame* aPrevInFlow)
{
nsresult rv = nsBoxFrame::Init(aContent, aParent, aPrevInFlow);
NS_ENSURE_SUCCESS(rv, rv);
nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this);
if (!scrollFrame)
return rv;
nsIScrollableView* scrollableView = scrollFrame->GetScrollableView();
scrollableView->SetScrollProperties(NS_SCROLL_PROPERTY_ALWAYS_BLIT);
nsIBox* verticalScrollbar = scrollFrame->GetScrollbarBox(PR_TRUE);
if (!verticalScrollbar) {
NS_ERROR("Unable to install the scrollbar mediator on the listbox widget. You must be using GFX scrollbars.");
return NS_ERROR_FAILURE;
if (scrollFrame) {
nsIScrollableView* scrollableView = scrollFrame->GetScrollableView();
scrollableView->SetScrollProperties(NS_SCROLL_PROPERTY_ALWAYS_BLIT);
nsIBox* verticalScrollbar = scrollFrame->GetScrollbarBox(PR_TRUE);
if (verticalScrollbar) {
nsIScrollbarFrame* scrollbarFrame = nsnull;
CallQueryInterface(verticalScrollbar, &scrollbarFrame);
scrollbarFrame->SetScrollbarMediatorContent(GetContent());
}
}
nsCOMPtr<nsIScrollbarFrame> scrollbarFrame(do_QueryInterface(verticalScrollbar));
scrollbarFrame->SetScrollbarMediatorContent(GetContent());
nsCOMPtr<nsIFontMetrics> fm;
PresContext()->DeviceContext()->GetMetricsFor(
GetStyleContext()->GetStyleFont()->mFont, *getter_AddRefs(fm)