Bug 647813. XUL popups anchored to a <select> should not size themselves to the <select>. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 15 Jan 2014 16:07:31 +1300
changeset 164133 3d2f331a57a470535cc355fa071e14ecb774f90e
parent 164132 6ce27f9e743f961f892b9e4998ae5ef70559f6c4
child 164134 15b13a7c66a55238b7ca02f6e5e35e044896bd79
push id26026
push userphilringnalda@gmail.com
push dateSat, 18 Jan 2014 23:17:27 +0000
treeherdermozilla-central@61fd0f987cf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs647813
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 647813. XUL popups anchored to a <select> should not size themselves to the <select>. r=mats
layout/xul/nsMenuFrame.cpp
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -693,27 +693,20 @@ nsMenuFrame::CloseMenu(bool aDeselectMen
   nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
   if (pm && HasPopup())
     pm->HidePopup(GetPopup()->GetContent(), false, aDeselectMenu, true);
 }
 
 bool
 nsMenuFrame::IsSizedToPopup(nsIContent* aContent, bool aRequireAlways)
 {
-  bool sizeToPopup;
-  if (aContent->Tag() == nsGkAtoms::select)
-    sizeToPopup = true;
-  else {
-    nsAutoString sizedToPopup;
-    aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup, sizedToPopup);
-    sizeToPopup = sizedToPopup.EqualsLiteral("always") ||
-                  (!aRequireAlways && sizedToPopup.EqualsLiteral("pref"));
-  }
-  
-  return sizeToPopup;
+  nsAutoString sizedToPopup;
+  aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::sizetopopup, sizedToPopup);
+  return sizedToPopup.EqualsLiteral("always") ||
+         (!aRequireAlways && sizedToPopup.EqualsLiteral("pref"));
 }
 
 nsSize
 nsMenuFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState)
 {
   nsSize size = nsBoxFrame::GetMinSize(aBoxLayoutState);
   DISPLAY_MIN_SIZE(this, size);