Bug 698876 - Port |Bug 692616 - large images not be scaled down to windows size| to SeaMonkey r=neil a=CLOSED TREE
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 02 Nov 2011 00:24:12 +0000
changeset 9598 79fa4eac2aee9fcf02838a5d599e616e3611391f
parent 9597 46b0cf2f1a85d26ac091ee0d0791af9dd12a280f
child 9599 4a14fc769a0d90d8845e2e534929f287183e933e
push id281
push userbugzilla@standard8.plus.com
push dateWed, 21 Dec 2011 12:08:36 +0000
treeherdercomm-beta@6d973fa5c2e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, CLOSED
bugs698876, 692616
Bug 698876 - Port |Bug 692616 - large images not be scaled down to windows size| to SeaMonkey r=neil a=CLOSED TREE
suite/mailnews/mailWindow.js
suite/mailnews/mailWindowOverlay.js
--- a/suite/mailnews/mailWindow.js
+++ b/suite/mailnews/mailWindow.js
@@ -175,17 +175,17 @@ function messagePaneOnResize(event)
   // scale any overflowing images
   var messagepane = getMessageBrowser();
   var doc = messagepane.contentDocument;
   var imgs = doc.images;
   for each (var img in imgs)
   {
     if (img.className == "moz-attached-image")
     {
-      if (img.naturalWidth <= doc.width)
+      if (img.naturalWidth <= doc.body.clientWidth)
       {
         img.removeAttribute("isshrunk");
         img.removeAttribute("overflowing");
       }
       else if (img.hasAttribute("shrinktofit"))
       {
         img.setAttribute("isshrunk", "true");
         img.removeAttribute("overflowing");
--- a/suite/mailnews/mailWindowOverlay.js
+++ b/suite/mailnews/mailWindowOverlay.js
@@ -2812,17 +2812,18 @@ function OnMsgParsed(aUrl)
   Services.obs.notifyObservers(msgWindow.msgHeaderSink,
                                "MsgMsgDisplayed", msgURI);
 
   // scale any overflowing images
   var doc = getMessageBrowser().contentDocument;
   var imgs = doc.getElementsByTagName("img");
   for each (var img in imgs)
   {
-    if (img.className == "moz-attached-image" && img.naturalWidth > doc.width)
+    if (img.className == "moz-attached-image" &&
+        img.naturalWidth > doc.body.clientWidth)
     {
       if (img.hasAttribute("shrinktofit"))
         img.setAttribute("isshrunk", "true");
       else
         img.setAttribute("overflowing", "true");
     }
   }
 }