Try to fix topcrash bug 752428 by null-checking the result of nsIPresShell::FrameManager(), which isn't supposed to need it. r=roc approval-mozilla-aurora=mfinkle
authorL. David Baron <dbaron@dbaron.org>
Mon, 07 May 2012 17:02:01 +0200
changeset 95754 9fc473b657fb88007523c43ede4d970ed50a88c8
parent 95753 1b3adfb8004d007bbc5e5b3467db5b56d2556267
child 95755 e56e0283291ca8d43af0b6405c973204b6cfd7a4
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs752428
milestone14.0a2
Try to fix topcrash bug 752428 by null-checking the result of nsIPresShell::FrameManager(), which isn't supposed to need it. r=roc approval-mozilla-aurora=mfinkle
dom/base/nsDOMWindowUtils.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -302,20 +302,23 @@ MaybeReflowForInflationScreenWidthChange
         nsCOMPtr<nsIMarkupDocumentViewer> mudv = do_QueryInterface(cv);
         if (mudv) {
           nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> > array;
           mudv->AppendSubtree(array);
           for (PRUint32 i = 0, iEnd = array.Length(); i < iEnd; ++i) {
             nsCOMPtr<nsIPresShell> shell;
             nsCOMPtr<nsIContentViewer> cv = do_QueryInterface(array[i]);
             cv->GetPresShell(getter_AddRefs(shell));
-            nsIFrame *rootFrame = shell->GetRootFrame();
-            if (rootFrame) {
-              shell->FrameNeedsReflow(rootFrame, nsIPresShell::eResize,
-                                      NS_FRAME_IS_DIRTY);
+            nsFrameManager *fm = shell->FrameManager();
+            if (fm) {
+              nsIFrame *rootFrame = fm->GetRootFrame();
+              if (rootFrame) {
+                shell->FrameNeedsReflow(rootFrame, nsIPresShell::eResize,
+                                        NS_FRAME_IS_DIRTY);
+              }
             }
           }
         }
       }
     }
   }
 }