Bug 1243011, skip popup open check for back button context menu so that it doesn't sometimes contain the wrong items, r=felipe
authorNeil Deakin <neil@mozilla.com>
Wed, 13 Apr 2016 13:15:57 -0400
changeset 330917 9424f63828ebaf3563cad850ce1cc5f865231f70
parent 330916 b00232b9f65b6195f4f01167747325fd6c140a9c
child 330918 01eb273e37b6043dd197a539f6d7f99c9eee8ae2
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1243011
milestone48.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 1243011, skip popup open check for back button context menu so that it doesn't sometimes contain the wrong items, r=felipe
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3722,19 +3722,22 @@ function FillHistoryMenu(aParent) {
   {
     let count = sessionHistory.entries.length;
 
     if (!initial) {
       if (count <= 1) {
         // if there is only one entry now, close the popup.
         aParent.hidePopup();
         return;
-      } else if (!aParent.parentNode.open) {
+      } else if (aParent.id != "backForwardMenu" && !aParent.parentNode.open) {
         // if the popup wasn't open before, but now needs to be, reopen the menu.
-        // It should trigger FillHistoryMenu again.
+        // It should trigger FillHistoryMenu again. This might happen with the
+        // delay from click-and-hold menus but skip this for the context menu
+        // (backForwardMenu) rather than figuring out how the menu should be
+        // positioned and opened as it is an extreme edgecase.
         aParent.parentNode.open = true;
         return;
       }
     }
 
     let index = sessionHistory.index;
     let half_length = Math.floor(MAX_HISTORY_MENU_ITEMS / 2);
     let start = Math.max(index - half_length, 0);