Bug 625561 - Flickering due to late application of external CSS when loaded/reloaded; inconsistent across browser windows [r=ian, a=blocking2.0:final+]
authorTim Taubert <tim.taubert@gmx.de>
Sat, 05 Feb 2011 10:10:43 +0100
changeset 61992 20ffcaad9700b0add9cf1a91b38f2256d3622945
parent 61991 f0205c1265ea39a28b70f1a9af2934c45b5ac8e9
child 61993 378f8ebcc920cae1a9574d0a69e396b7434b147f
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersian, blocking2
bugs625561
milestone2.0b12pre
Bug 625561 - Flickering due to late application of external CSS when loaded/reloaded; inconsistent across browser windows [r=ian, a=blocking2.0:final+]
browser/base/content/tabview/tabitems.js
browser/base/content/test/tabview/browser_tabview_bug594958.js
--- a/browser/base/content/tabview/tabitems.js
+++ b/browser/base/content/tabview/tabitems.js
@@ -1344,26 +1344,22 @@ TabCanvas.prototype = {
   },
 
   // ----------
   // Function: _calculateClippingRect
   // Calculate the clipping rect that will be projected to the tab's
   // 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);
 
     // very short pages in combination with a very wide browser window force us
     // to extend the clipping rect and add some empty space around the thumb
     let factor = 0.7;
     if (width < maxWidth * factor) {
       width = maxWidth * factor;
--- a/browser/base/content/test/tabview/browser_tabview_bug594958.js
+++ b/browser/base/content/test/tabview/browser_tabview_bug594958.js
@@ -34,32 +34,32 @@ function test() {
               ' margin: 0 auto;"></div></body></html>';
 
   // very short page that produces black bars at the bottom
   let html2 = '<html><body style="background-color: #00f;"></body></html>';
 
   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',
     colors: [
       {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: '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]}
     ]
   }];
 
   let next = function () {
     if (!tests.length) {
       finishTest();
       return;