Backing out changeset 1bdd5da49865 (for bug 376662) due to regression bug 453661

This commit is contained in:
Robert O'Callahan
2008-09-05 15:40:06 +12:00
parent 6a0ac422da
commit 92adcbca76
17 changed files with 127 additions and 68 deletions

View File

@@ -885,9 +885,6 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame)
nsPresContext* presContext = PresContext();
nsIFrame* rootFrame = presContext->PresShell()->FrameManager()->GetRootFrame();
NS_ASSERTION(rootFrame->GetView() && GetView() &&
rootFrame->GetView() == GetView()->GetParent(),
"rootFrame's view is not our view's parent???");
// if the frame is not specified, use the anchor node passed to ShowPopup. If
// that wasn't specified either, use the root frame. Note that mAnchorContent
@@ -1240,9 +1237,11 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame)
presContext->GetViewManager()->MoveViewTo(GetView(), xpos, ypos);
// Now that we've positioned the view, sync up the frame's origin.
// Note that (xpos,ypos) is the position relative to rootFrame.
nsBoxFrame::SetPosition(nsPoint(xpos, ypos) -
GetParent()->GetOffsetTo(rootFrame));
nsPoint frameOrigin = GetPosition();
nsPoint offsetToView;
GetOriginToViewOffset(offsetToView, nsnull);
frameOrigin -= offsetToView;
nsBoxFrame::SetPosition(frameOrigin);
if (sizedToPopup) {
nsBoxLayoutState state(PresContext());