Bug 634788 we change the displayport way too often (OOM fix) r=mbrubeck
authorBenjamin Stover <bstover@mozilla.com>
Thu, 17 Feb 2011 11:19:51 -0800
changeset 67400 edb6a3b5dace02f599fafb062c7b81f4ddc428c5
parent 67399 bd50b812aedee78d685022c94681cfab1c0c1e58
child 67401 80287a75ad45af4a4a36f03c33387c7d114e1e72
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)
reviewersmbrubeck
bugs634788
Bug 634788 we change the displayport way too often (OOM fix) r=mbrubeck
mobile/chrome/content/bindings/browser.xml
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -871,20 +871,20 @@
             let contentSize = this._getContentSize();
             let contentWidth = contentSize.width;
             let contentHeight = contentSize.height;
 
             // There are common cases, such as long skinny pages, where our cache size is
             // bigger than our content size. In those cases, we take that sliver of leftover
             // space and apply it to the other dimension.
             if (contentWidth < cacheWidth) {
-              cacheHeight += (cacheWidth - contentWidth) * contentHeight / contentWidth;
+              cacheHeight += (cacheWidth - contentWidth) * cacheHeight / cacheWidth;
               cacheWidth = contentWidth;
             } else if (contentHeight < cacheHeight) {
-              cacheWidth += (cacheHeight - contentHeight) * contentWidth / contentHeight;
+              cacheWidth += (cacheHeight - contentHeight) * cacheWidth / cacheHeight;
               cacheHeight = contentHeight;
             }
 
             return { width: cacheWidth, height: cacheHeight };
           },
 
           _sendDisplayportUpdate: function(scrollX, scrollY) {
             let self = this.self;