Bug 387548, use sizetopopup to set popup size when an anchor is used, fixes wrong size on seamonkey autocomplete field, r+sr=bz
authorenndeakin@sympatico.ca
Wed, 18 Jul 2007 08:24:57 -0700
changeset 3612 0a7fce118db3cd91aa4fcd98db59f2fb8071bebb
parent 3611 9404837c389e8e2dbfbe54bae3ecc1f462fec92d
child 3613 0fe57234014a3639961821f62f23bb0df34ce1e1
push idunknown
push userunknown
push dateunknown
bugs387548
milestone1.9a7pre
Bug 387548, use sizetopopup to set popup size when an anchor is used, fixes wrong size on seamonkey autocomplete field, r+sr=bz
layout/xul/base/src/nsMenuPopupFrame.cpp
--- a/layout/xul/base/src/nsMenuPopupFrame.cpp
+++ b/layout/xul/base/src/nsMenuPopupFrame.cpp
@@ -855,17 +855,18 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
     }
     else {
       aAnchorFrame = presContext->PresShell()->FrameManager()->GetRootFrame();
     }
 
     if (!aAnchorFrame)
       return NS_OK;
   }
-  else {
+
+  if (aAnchorFrame->GetContent()) {
     // the popup should be the same size as the anchor menu, for example, a menulist.
     sizedToPopup = nsMenuFrame::IsSizedToPopup(aAnchorFrame->GetContent(), PR_FALSE);
   }
 
   // |containingView|
   //   The view that contains the frame that is invoking this popup. This is 
   //   the canvas view inside the scrollport view. It can have negative bounds
   //   if the canvas is scrolled so that part is off screen.