Bug 407601, use preferred size when calculating popup position and size instead of current size, fixes extraneous layouts and scrolling position changes, r+sr=bz,a=shrep
This commit is contained in:
@@ -748,9 +748,9 @@ nsMenuFrame::DoLayout(nsBoxLayoutState& aState)
|
||||
prefSize.width = mRect.width;
|
||||
|
||||
// if the pref size changed then set bounds to be the pref size
|
||||
PRBool sizeChanged = (mPopupFrame->GetRect().Size() != prefSize);
|
||||
PRBool sizeChanged = (mPopupFrame->PreferredSize() != prefSize);
|
||||
if (sizeChanged) {
|
||||
mPopupFrame->SetBounds(aState, nsRect(0,0,prefSize.width, prefSize.height));
|
||||
mPopupFrame->SetPreferredBounds(aState, nsRect(0,0,prefSize.width, prefSize.height));
|
||||
}
|
||||
|
||||
// if the menu has just been opened, or its size changed, position
|
||||
|
||||
Reference in New Issue
Block a user