Bug 550029. Don't try to run treeview script if the document global object has gone away. r=smaug
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 01 Apr 2010 20:32:13 +1300
changeset 40082 6a398023b956e4a7a01d1918a5c8c06abf6547d4
parent 40081 4f440b68d7b15f101602408380100e1c24302b65
child 40083 d1103a293d89b157b1b528d956f8fce0b4f09545
push id12545
push userrocallahan@mozilla.com
push dateThu, 01 Apr 2010 07:32:34 +0000
treeherdermozilla-central@6a398023b956 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs550029
milestone1.9.3a4pre
releases
nightly linux32
3.7a4pre / 20100401034504
nightly linux64
3.7a4pre / 20100401030617
nightly mac
3.7a4pre / 20100401030624
nightly win32
3.7a4pre / 20100401051847
Bug 550029. Don't try to run treeview script if the document global object has gone away. r=smaug
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -2808,17 +2808,19 @@ nsTreeBodyFrame::BuildDisplayList(nsDisp
   // REVIEW: why did we paint if we were collapsed? that makes no sense!
   if (!IsVisibleForPainting(aBuilder))
     return NS_OK; // We're invisible.  Don't paint.
 
   // Handles painting our background, border, and outline.
   nsresult rv = nsLeafBoxFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (!mView)
+  // Bail out now if there's no view or we can't run script because the
+  // document is a zombie
+  if (!mView || !GetContent()->GetCurrentDoc()->GetScriptGlobalObject())
     return NS_OK;
 
   return aLists.Content()->AppendNewToTop(new (aBuilder)
       nsDisplayGeneric(this, ::PaintTreeBody, "XULTreeBody"));
 }
 
 void
 nsTreeBodyFrame::PaintTreeBody(nsIRenderingContext& aRenderingContext,