Bug 625561 - Flickering due to late application of external CSS when loaded/reloaded; inconsistent across browser windows [r=ian, a=blocking2.0:final+]

This commit is contained in:
Tim Taubert 2011-02-05 10:10:43 +01:00
parent 6b25650d0d
commit 52c2fb7b58
2 changed files with 6 additions and 10 deletions

View File

@ -1349,16 +1349,12 @@ TabCanvas.prototype = {
// thumbnail canvas.
_calculateClippingRect: function TabCanvas__calculateClippingRect(origWidth, origHeight) {
let win = this.tab.linkedBrowser.contentWindow;
let body = win.document.body;
// TODO BUG 631593: retrieve actual scrollbar width
// 25px is supposed to be width of the vertical scrollbar
let maxWidth = win.innerWidth - 25;
let maxHeight = win.innerHeight;
if (body) {
maxWidth = Math.max(maxWidth, body.scrollWidth - win.scrollX);
maxHeight = Math.max(maxHeight, body.scrollHeight - win.scrollY);
}
let height = Math.min(maxHeight, Math.floor(origHeight * maxWidth / origWidth));
let width = Math.floor(origWidth * height / origHeight);

View File

@ -39,9 +39,9 @@ function test() {
let tests = [{
url: 'data:text/html,' + html1,
colors: [
{right: [0, 0, 255], bottom: [255, 255, 255]},
{right: [0, 0, 255], bottom: [255, 255, 255]},
{right: [0, 0, 255], bottom: [255, 255, 255]}
{right: [255, 255, 255], bottom: [255, 255, 255]},
{right: [255, 255, 255], bottom: [255, 255, 255]},
{right: [255, 255, 255], bottom: [255, 255, 255]}
]
}, {
url: 'about:blank',
@ -54,7 +54,7 @@ function test() {
url: 'data:text/html,' + html2,
colors: [
{right: [0, 0, 255], bottom: [0, 0, 255]},
{right: [0, 0, 255], bottom: [255, 255, 255]},
{right: [0, 0, 255], bottom: [0, 0, 255]},
{right: [0, 0, 255], bottom: [0, 0, 255]}
]
}];