Bug 627068 - Don't set displayport for background tabs [r=stechz]
authorWes Johnston <wjohnston@mozilla.com>
Wed, 19 Jan 2011 15:24:34 -0800
changeset 2670 748bbf883616aea80c4e29a8494326ba175e7e88
parent 2669 8b2710b520261614ea840f4c0ca801c034b0911c
child 2671 259ff5c6453667437a7f9ff0f32b3e9520eb64c3
push id2243
push userwjohnston@mozilla.com
push dateWed, 19 Jan 2011 23:25:07 +0000
reviewersstechz
bugs627068
Bug 627068 - Don't set displayport for background tabs [r=stechz]
chrome/content/bindings/browser.xml
chrome/content/browser.js
--- a/chrome/content/bindings/browser.xml
+++ b/chrome/content/bindings/browser.xml
@@ -764,18 +764,21 @@
             delete this.self._contentViews[this._id];
           },
 
           /**
            * The cache viewport is what parts of content is cached in the parent process for
            * fast scrolling. This syncs that up with the current projection viewport.
            */
           _updateCacheViewport: function() {
+            let self = this.self;
+            if (!self.active)
+               return;
+
             let contentView = this._contentView;
-            let self = this.self;
             let viewportSize = this._getViewportSize();
             let cacheWidth = self._cacheRatioWidth * viewportSize.width;
             let cacheHeight = self._cacheRatioHeight * viewportSize.height;
 
             // Put the center point of the displayport at the center point
             // of the viewport.
             let cacheX = contentView.scrollX + viewportSize.width / 2 - cacheWidth / 2;
             let cacheY = contentView.scrollY + viewportSize.height / 2 - cacheHeight / 2;
--- a/chrome/content/browser.js
+++ b/chrome/content/browser.js
@@ -2455,16 +2455,19 @@ function Tab(aURI, aParams) {
 
   // Set to 0 since new tabs that have not been viewed yet are good tabs to
   // toss if app needs more memory.
   this.lastSelected = 0;
 
   // aParams is an object that contains some properties for the initial tab
   // loading like flags, a referrerURI, a charset or even a postData.
   this.create(aURI, aParams || {});
+
+  // default tabs to inactive (i.e. no display port)
+  this.active = false;
 }
 
 Tab.prototype = {
   get browser() {
     return this._browser;
   },
 
   get notification() {