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:
2007-12-19 08:37:32 -08:00
parent c70d85610d
commit b54b2e501a
5 changed files with 62 additions and 10 deletions

View File

@@ -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