Bug 1488084 - Follow-up: Restore over-zealously removed variable 'sourceDoc'. r=mkmelin DONTBUILD
authorJorg K <jorgk@jorgk.com>
Sat, 15 Sep 2018 22:20:35 +0200
changeset 33157 ffcdf9f4e019bde9740dbc1f3061d0230650bd64
parent 33156 9724c66105bfe2e18c68153f97c66f8f7e50edfa
child 33158 d01e5283a6d7ea8c7b5643f314f92ce48d71936c
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin
bugs1488084
Bug 1488084 - Follow-up: Restore over-zealously removed variable 'sourceDoc'. r=mkmelin 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