Bug 790856, ensure bounds on the previous viewer, r=bz, a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 21 Sep 2012 10:40:14 +0300
changeset 106918 c039da3793f755b7c5f881623acb69e931a1367b
parent 106917 d94b98f4942617bcdfde1a6804aa95490b712a79
child 106919 592da114f13829036a6bf67310665d9e330b46c3
push id2131
push useropettay@mozilla.com
push dateFri, 21 Sep 2012 07:45:58 +0000
treeherdermozilla-aurora@c039da3793f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, akeybl
Bug 790856, ensure bounds on the previous viewer, r=bz, a=akeybl
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1893,18 +1893,20 @@ DocumentViewerImpl::SetBounds(const nsIn
   // If there's a previous viewer, it's the one that's actually showing,
   // so be sure to resize it as well so it paints over the right area.
   // This may slow down the performance of the new page load, but resize
   // during load is also probably a relatively unusual condition
   // relating to things being hidden while something is loaded.  It so
   // happens that Firefox does this a good bit with its infobar, and it
   // looks ugly if we don't do this.
-  if (mPreviousViewer)
-    mPreviousViewer->SetBounds(aBounds);
+  if (mPreviousViewer) {
+    nsCOMPtr<nsIContentViewer> previousViewer = mPreviousViewer;
+    previousViewer->SetBounds(aBounds);
+  }
   return NS_OK;
 DocumentViewerImpl::Move(int32_t aX, int32_t aY)