From 46ee70938d0b02853c209f5f10ee990bec31ff3f Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Thu, 14 Sep 2006 06:10:25 +0000 Subject: [PATCH] Don't dismiss the context menu so eagerly for subframe loads b=329521 r+sr=jag --- suite/browser/nsBrowserStatusHandler.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/suite/browser/nsBrowserStatusHandler.js b/suite/browser/nsBrowserStatusHandler.js index 7ade7332e497..54b69ff53b6e 100644 --- a/suite/browser/nsBrowserStatusHandler.js +++ b/suite/browser/nsBrowserStatusHandler.js @@ -261,7 +261,21 @@ nsBrowserStatusHandler.prototype = onLocationChange : function(aWebProgress, aRequest, aLocation) { - document.getElementById("contentAreaContextMenu").hidePopup(); + if (gContextMenu) { + // Optimise for the common case + if (aWebProgress.DOMWindow == content) + gContextMenu.menu.hidePopup(); + else { + for (var contextWindow = gContextMenu.target.ownerDocument.defaultView; + contextWindow != contextWindow.parent; + contextWindow = contextWindow.parent) { + if (contextWindow == aWebProgress.DOMWindow) { + gContextMenu.menu.hidePopup(); + break; + } + } + } + } // XXX temporary hack for bug 104532. // Depends heavily on setOverLink implementation