Bug 692616 - large images not be scaled down to windows size. r=bienvenu,a=Standard8 COMM80_20111031_RELBRANCH
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 01 Nov 2011 19:24:50 +0000
branchCOMM80_20111031_RELBRANCH
changeset 8973 7760a2b833fdd6830d9289b8c73f8dc640399005
parent 8970 b2296f357e705b6ef7427aa17f6f254604faf04c
child 8974 7d3a510fc227b4b4cb0f3ecc7db43f433664cb7e
push idunknown
push userunknown
push dateunknown
reviewersbienvenu, Standard8
bugs692616
Bug 692616 - large images not be scaled down to windows size. r=bienvenu,a=Standard8
mail/base/content/contentAreaClick.js
mail/base/content/mailWindowOverlay.js
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -84,17 +84,17 @@
     // scale any overflowing images
     var messagepane = document.getElementById("messagepane");
     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/mail/base/content/mailWindowOverlay.js
+++ b/mail/base/content/mailWindowOverlay.js
@@ -2880,17 +2880,17 @@ function OnMsgParsed(aUrl)
                                   .getService(Components.interfaces.nsIObserverService);
   observerService.notifyObservers(msgWindow.msgHeaderSink, "MsgMsgDisplayed", msgURI);
 
   // scale any overflowing images
   var doc = document.getElementById("messagepane").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");
     }
   }
 }