From 2aa905d8b9232b25face9c7abeeb01a04e89e5a1 Mon Sep 17 00:00:00 2001 From: Shane Caraveo Date: Wed, 10 Feb 2016 12:23:25 -0800 Subject: [PATCH] Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs --- browser/base/content/nsContextMenu.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index a840ff89e890..658eb22f4905 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -31,6 +31,7 @@ nsContextMenu.prototype = { return; this.hasPageMenu = false; + this.isContentSelected = !this.selectionInfo.docSelectionIsCollapsed; if (!aIsShift) { if (this.isRemote) { this.hasPageMenu = @@ -71,6 +72,8 @@ nsContextMenu.prototype = { Ci.nsIPrefLocalizedString).data; } catch (e) { } + // Reset after "on-build-contextmenu" notification in case selection was + // changed during the notification. this.isContentSelected = !this.selectionInfo.docSelectionIsCollapsed; this.onPlainTextLink = false;