Commits

Neil Rashbrook  committed d308ba0 Draft

try: -b o -p linux64

  • Participants
  • Parent commits a2939ba

Comments (0)

Files changed (3)

File layout/xul/nsMenuFrame.cpp

 }
 
 bool
-nsMenuFrame::IsSizedToPopup(nsIContent* aContent, bool aRequireAlways)
+nsMenuFrame::IsSizedToPopup(bool aRequireAlways)
 {
   nsAutoString sizedToPopup;
-  aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup, sizedToPopup);
+  mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup, sizedToPopup);
   return sizedToPopup.EqualsLiteral("always") ||
          (!aRequireAlways && sizedToPopup.EqualsLiteral("pref"));
 }
   nsSize size = nsBoxFrame::GetMinSize(aBoxLayoutState);
   DISPLAY_MIN_SIZE(this, size);
 
-  if (IsSizedToPopup(mContent, true))
+  if (IsSizedToPopup(true))
     SizeToPopup(aBoxLayoutState, size);
 
   return size;
 
   nsMenuPopupFrame* popupFrame = GetPopup();
   if (popupFrame) {
-    bool sizeToPopup = IsSizedToPopup(mContent, false);
+    bool sizeToPopup = IsSizedToPopup(false);
     popupFrame->LayoutPopup(aState, this, GetAnchor()->GetPrimaryFrame(), sizeToPopup);
   }
 
 
   // If we are using sizetopopup="always" then
   // nsBoxFrame will already have enforced the minimum size
-  if (!IsSizedToPopup(mContent, true) &&
-      IsSizedToPopup(mContent, false) &&
+  if (!IsSizedToPopup(true) &&
+      IsSizedToPopup(false) &&
       SizeToPopup(aState, size)) {
     // We now need to ensure that size is within the min - max range.
     nsSize minSize = nsBoxFrame::GetMinSize(aState);

File layout/xul/nsMenuFrame.h

   }
 #endif
 
-  static bool IsSizedToPopup(nsIContent* aContent, bool aRequireAlways);
+  bool IsSizedToPopup(bool aRequireAlways);
 
 protected:
   friend class nsMenuTimerMediator;

File layout/xul/nsMenuPopupFrame.cpp

   // the parent menu has a sizetopopup attribute. In this case the size of
   // the parent menu is dependent on the size of the popup, so the frames
   // need to exist in order to calculate this size.
-  nsIContent* parentContent = mContent->GetParent();
-  return (parentContent &&
-          !parentContent->HasAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup));
+  nsMenuFrame* parentMenu = do_QueryFrame(GetParent());
+  return parentMenu && !parentMenu->IsSizedToPopup(false);
 }
 
 void