Bug 1118502 - Part 1: Fixup grabbing of documentURIObject. r=mconley, a=sledru
authorNathan Froyd <froydnj@mozilla.com>
Fri, 06 Feb 2015 13:02:44 -0500
changeset 249722 55e36fd42ae6142a98480c6b32d43ac02d13c2f5
parent 249721 19957a73625f0d59e0848a051a554bfc1ec21b92
child 249723 8b352186edd845128e5fd222cfc8adf0839c7612
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, sledru
bugs1118502, 1031264
milestone37.0a2
Bug 1118502 - Part 1: Fixup grabbing of documentURIObject. r=mconley, a=sledru The patch for bug 1031264 factored out an _openLinkInParameters function. But this new function grabbed the referrerURI from |document|, rather from the passed in |doc|, whereas all the callers had obtained |referrerURI| from the (to-be-passed-in) |doc| object. Let's fix this mix-up before going any further.
browser/base/content/nsContextMenu.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -861,17 +861,17 @@ nsContextMenu.prototype = {
     }
     // Otherwise make sure that nothing in the parent chain disables spellchecking
     return aNode.spellcheck;
   },
 
   _openLinkInParameters : function (doc, extra) {
     let params = { charset: doc.characterSet };
     if (!BrowserUtils.linkHasNoReferrer(this.link))
-      params.referrerURI = document.documentURIObject;
+      params.referrerURI = doc.documentURIObject;
     for (let p in extra)
       params[p] = extra[p];
     return params;
   },
 
   // Open linked-to URL in a new window.
   openLink : function () {
     var doc = this.target.ownerDocument;