Bug 692616 - large images not be scaled down to windows size. r=bienvenu,a=Standard8
--- 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
@@ -2879,17 +2879,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");
}
}
}