Bug 1518938: Make it possible to hide items from the application menu. r=spohl
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 14 Jan 2019 18:57:49 +0000
changeset 510872 50b3268954b1300941453d11934d032478425a55
parent 510871 da7597af4dd14b004ca141dc0a42f6683b8f5943
child 510884 8ec327de0ba7c25c185b887a57877657bda20d47
child 510885 f69c74d69b46bb866b2431dca9267557767e5749
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1518938
milestone66.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 1518938: Make it possible to hide items from the application menu. r=spohl Differential Revision: https://phabricator.services.mozilla.com/D16107
widget/cocoa/nsMenuBarX.mm
--- a/widget/cocoa/nsMenuBarX.mm
+++ b/widget/cocoa/nsMenuBarX.mm
@@ -592,16 +592,22 @@ NSMenuItem* nsMenuBarX::CreateNativeAppM
   }
 
   RefPtr<mozilla::dom::Element> menuItem =
     doc->GetElementById(nodeID);
   if (!menuItem) {
     return nil;
   }
 
+  // Check collapsed rather than hidden since the app menu items are always
+  // hidden in AquifyMenuBar.
+  if (menuItem->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed, nsGkAtoms::_true, eCaseMatters)) {
+    return nil;
+  }
+
   // Get information from the gecko menu item
   nsAutoString label;
   nsAutoString modifiers;
   nsAutoString key;
   menuItem->GetAttribute(NS_LITERAL_STRING("label"), label);
   menuItem->GetAttribute(NS_LITERAL_STRING("modifiers"), modifiers);
   menuItem->GetAttribute(NS_LITERAL_STRING("key"), key);