Bug 640768 - Ensure thumbnails don't extend beyond content. [r=mfinkle]

This commit is contained in:
Wes Johnston 2011-03-18 11:41:12 -07:00
parent 4142440d41
commit e48af138e9

View File

@ -66,7 +66,17 @@
let ratio = tabHeight / tabWidth;
if (browser.contentDocumentWidth > 0)
width = Math.min(width, browser.contentDocumentWidth);
height = width * ratio;
if (browser.contentDocumentHeight > 0)
height = Math.min(height, browser.contentDocumentHeight);
let newHeight = width * ratio;
if (height >= newHeight) {
height = newHeight;
} else {
// the browser aspect ratio does not match the tabs aspect ratio
width = height / ratio;
}
let thumbnail = this.thumbnail;
thumbnail.removeAttribute("empty");