Bug 629035. Don't try to reconstruct frames if we don't have any. r=dbaron, a=blocker
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 28 Jan 2011 09:29:21 -0500
changeset 61541 fe8180d48b5dcf9c15a73112017e36a28855fa31
parent 61540 5e7903dbbd2854d372da018f273665749c7dfbe0
child 61542 979ef5bad8c4c63399d63ffe121b11454e9c920b
push idunknown
push userunknown
push dateunknown
reviewersdbaron, blocker
bugs629035
milestone2.0b11pre
Bug 629035. Don't try to reconstruct frames if we don't have any. r=dbaron, a=blocker
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -5145,16 +5145,23 @@ PresShell::ContentRemoved(nsIDocument *a
                                     &didReconstruct);
 
   VERIFY_STYLE_TREE;
 }
 
 nsresult
 PresShell::ReconstructFrames(void)
 {
+  NS_PRECONDITION(!FrameManager()->GetRootFrame() || mDidInitialReflow,
+                  "Must not have root frame before initial reflow");
+  if (!mDidInitialReflow) {
+    // Nothing to do here
+    return NS_OK;
+  }
+
   nsCOMPtr<nsIPresShell> kungFuDeathGrip(this);
 
   // Have to make sure that the content notifications are flushed before we
   // start messing with the frame model; otherwise we can get content doubling.
   mDocument->FlushPendingNotifications(Flush_ContentAndNotify);
 
   nsAutoCauseReflowNotifier crNotifier(this);
   mFrameConstructor->BeginUpdate();