Bug 790856, ensure bounds on the previous viewer, r=bz, a=akeybl
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 21 Sep 2012 10:39:16 +0300
changeset 81995 62ad5b34715dd0a50b38eba04337083e61dc02fe
parent 81994 b46718d660187b70da4ac8448dafb39d5ad1eacf
child 81996 03d28718012f2493039404e97e5af57b929b6071
push id271
push useropettay@mozilla.com
push dateFri, 21 Sep 2012 07:45:53 +0000
reviewersbz, akeybl
bugs790856
milestone10.0.8esrpre
Bug 790856, ensure bounds on the previous viewer, r=bz, a=akeybl
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1904,18 +1904,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;
 }
 
 NS_IMETHODIMP
 DocumentViewerImpl::Move(PRInt32 aX, PRInt32 aY)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);