Bug 790856, ensure bounds on the previous viewer, r=bz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 21 Sep 2012 10:38:14 +0300
changeset 107670 48c4938eaf578127f2e68a4bfc51873dbe8e516d
parent 107669 9ae014a115b2dd3cd0864052e0e18a7f03df6677
child 107671 abada9261f82f56e527fe658f7472dd3973b4b8c
push id23500
push useropettay@mozilla.com
push dateFri, 21 Sep 2012 07:45:44 +0000
treeherdermozilla-central@48c4938eaf57 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs790856
milestone18.0a1
first release with
nightly linux32
48c4938eaf57 / 18.0a1 / 20120921030601 / files
nightly linux64
48c4938eaf57 / 18.0a1 / 20120921030601 / files
nightly mac
48c4938eaf57 / 18.0a1 / 20120921030601 / files
nightly win32
48c4938eaf57 / 18.0a1 / 20120921030601 / files
nightly win64
48c4938eaf57 / 18.0a1 / 20120921030601 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 790856, ensure bounds on the previous viewer, r=bz
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1894,18 +1894,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(int32_t aX, int32_t aY)
 {
   NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);