Bug 789482. Don't try to resize/move hidden popup views. r=roc

CalcWidgetBounds (which we use to compute widget bounds) contains an optimization for hidden popup views which makes it return wrong results for hidden popup views, so just don't bother if we have a hidden popup view.
This commit is contained in:
Timothy Nikkel 2012-09-19 22:12:36 -05:00
parent 65d7a8ceec
commit f6bafacbd9

View File

@ -248,9 +248,11 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,
nsWindowType type;
mWindow->GetWindowType(type);
if (curBounds.IsEmpty() && mDimBounds.IsEmpty() && type == eWindowType_popup) {
// Don't manipulate empty popup widgets. For example there's no point
// moving hidden comboboxes around, or doing X server roundtrips
if (type == eWindowType_popup &&
((curBounds.IsEmpty() && mDimBounds.IsEmpty()) ||
mVis == nsViewVisibility_kHide)) {
// Don't manipulate empty or hidden popup widgets. For example there's no
// point moving hidden comboboxes around, or doing X server roundtrips
// to compute their true screen position. This could mean that WidgetToScreen
// operations on these widgets don't return up-to-date values, but popup
// positions aren't reliable anyway because of correction to be on or off-screen.