Bug 1488084 - Follow-up: Restore over-zealously removed variable 'sourceDoc'. r=mkmelin a=jorgk DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sat, 15 Sep 2018 22:20:35 +0200
changeset 31816 9d06a03727864f4ca070ac561e2dec85c67c2b71
parent 31815 7403415b8190a3bd8601f1d92471b6871649ccf0
child 31817 72a8163cc7ea4050cdfdcc725c1b96edc002d364
push id73
push usermozilla@jorgk.com
push dateSat, 15 Sep 2018 20:24:28 +0000
treeherdercomm-esr60@9d06a0372786 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1488084
Bug 1488084 - Follow-up: Restore over-zealously removed variable 'sourceDoc'. r=mkmelin a=jorgk DONTBUILD
mail/base/content/mailWindow.js
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -55,17 +55,21 @@ function OnMailWindowUnload()
 
 
 /**
  * When copying/dragging, convert imap/mailbox URLs of images into data URLs so
  * that the images can be accessed in a paste elsewhere.
  */
 function onCopyOrDragStart(e) {
   let browser = getBrowser();
-  if (!browser || e.target.ownerDocument != browser.contentDocument) {
+  if (!browser) {
+    return;
+  }
+  let sourceDoc = browser.contentDocument;
+  if (e.target.ownerDocument != sourceDoc) {
     return; // We're only interested if this is in the message content.
   }
 
   let imgMap = new Map(); // Mapping img.src -> dataURL.
 
   // For copy, the data of what is to be copied is not accessible at this point.
   // Figure out what images are a) part of the selection and b) visible in
   // the current document. If their source isn't http or data already, convert