Bug 1489302 - Follow-up from Bug 1488084. Restore accidentally removed sourceDoc. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sun, 16 Sep 2018 12:34:24 +0200
changeset 28297 6b4a44972c3b4276a6adcfcce3732ef6247d5ce9
parent 28296 0b6424ff09a7b688e7935e220aa930ffd0835287
child 28298 883ee2aed9c0f0e50bd3530c984e3631cd3c858a
push id2124
push userfrgrahl@gmx.net
push dateSun, 16 Sep 2018 10:35:02 +0000
treeherdercomm-esr52@6b4a44972c3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, IanN
bugs1489302, 1488084
Bug 1489302 - Follow-up from Bug 1488084. Restore accidentally removed sourceDoc. r=IanN a=IanN
suite/mailnews/mailWindow.js
--- a/suite/mailnews/mailWindow.js
+++ b/suite/mailnews/mailWindow.js
@@ -62,19 +62,23 @@ 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) {
     // We're only interested if this is in the message content.
-    return; 
+    return;
   }
 
   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
   // them to data URLs.