Bug 610391 - Create the widget for drop-down comboboxes lazily, and tear it down when the drop-down is closed; r=roc

This commit is contained in:
Ehsan Akhgari
2011-03-21 14:28:10 -04:00
parent b7a792f43f
commit dd0e5ec1fc
5 changed files with 49 additions and 21 deletions

View File

@@ -3216,19 +3216,6 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
}
nsHTMLContainerFrame::CreateViewForFrame(scrollFrame, aBuildCombobox);
if (aBuildCombobox) {
// Give the drop-down list a popup widget
nsIView* view = scrollFrame->GetView();
NS_ASSERTION(view, "We asked for a view but didn't get one");
if (view) {
view->GetViewManager()->SetViewFloating(view, PR_TRUE);
nsWidgetInitData widgetData;
widgetData.mWindowType = eWindowType_popup;
widgetData.mBorderStyle = eBorderStyle_default;
view->CreateWidgetForPopup(&widgetData);
}
}
BuildScrollFrame(aState, aContent, aStyleContext, scrolledFrame,
geometricParent, scrollFrame);