Bug 698876 - Port |Bug 692616 - large images not be scaled down to windows size| to SeaMonkey r/a=neil
authorIan Neal <iann_cvs@blueyonder.co.uk>
Wed, 02 Nov 2011 00:20:48 +0000
changeset 8977 29722e076d509d1638e28d05125d9b2728c574e9
parent 8972 f1e64bc51f7bc2ceac8ffc03287eadecd97d9024
child 8978 053fae2d6e0fc03a002be11a620336250bae3dee
push id219
push useriann_cvs@blueyonder.co.uk
push dateWed, 02 Nov 2011 00:25:10 +0000
treeherdercomm-beta@29722e076d50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs698876, 692616
Bug 698876 - Port |Bug 692616 - large images not be scaled down to windows size| to SeaMonkey r/a=neil
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");
     }
   }
 }