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 67284 a8031b5d72dcca8da0b43ad10b9ba38ca0b71284
parent 67283 b443798cc44ca1dbfd5e7d91ae44860cb39c5de3
child 67285 dd70949c8c790ea9e3fe3be130a83323f847dfe7
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstechz
bugs627068
Bug 627068 - Don't set displayport for background tabs [r=stechz]
mobile/chrome/content/bindings/browser.xml
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/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/mobile/chrome/content/browser.js
+++ b/mobile/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() {