mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 03:18:41 +00:00
Bug 780661 - Update mDropdownCanGrow also when the position is currently outside viewport to allow a resize later at a different position. Also, don't call PositionFrameView unless the position really changed to avoid infinite number of calls to AbsolutelyPositionDropDown (via nsResizeDropdownAtFinalPosition event from NotifyGeometryChange). r=roc
This commit is contained in:
parent
60b0bda8c8
commit
5f8f44abac
@ -720,8 +720,15 @@ nsComboboxControlFrame::AbsolutelyPositionDropDown()
|
||||
// Align the right edge of the drop-down with the right edge of the control.
|
||||
dropdownPosition.x = GetRect().width - dropdownSize.width;
|
||||
}
|
||||
mDropdownFrame->SetPosition(dropdownPosition + translation);
|
||||
nsContainerFrame::PositionFrameView(mDropdownFrame);
|
||||
|
||||
// Don't position the view unless the position changed since it might cause
|
||||
// a call to NotifyGeometryChange() and an infinite loop here.
|
||||
const nsPoint currentPos = mDropdownFrame->GetPosition();
|
||||
const nsPoint newPos = dropdownPosition + translation;
|
||||
if (currentPos != newPos) {
|
||||
mDropdownFrame->SetPosition(newPos);
|
||||
nsContainerFrame::PositionFrameView(mDropdownFrame);
|
||||
}
|
||||
return eDropDownPositionFinal;
|
||||
}
|
||||
|
||||
|
@ -580,6 +580,7 @@ nsListControlFrame::ReflowAsDropdown(nsPresContext* aPresContext,
|
||||
if (above <= 0 && below <= 0) {
|
||||
state.SetComputedHeight(heightOfARow);
|
||||
mNumDisplayRows = 1;
|
||||
mDropdownCanGrow = GetNumberOfOptions() > 1;
|
||||
} else {
|
||||
nscoord bp = aReflowState.mComputedBorderPadding.TopBottom();
|
||||
nscoord availableHeight = NS_MAX(above, below) - bp;
|
||||
|
Loading…
Reference in New Issue
Block a user