Backout 9f6c579151c5 (bug 805745) for making bug 813024 worse.
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 16 Dec 2012 14:34:14 -0600
changeset 121769 62a769a3ae0e269485bcc1fd80f3dc8ba7f56919
parent 121768 463b740c3e2f77925dc48a47979bcf9fa5d27bba
child 121770 fbec2ea99d3ab6eab8de7d78117aa412fd1ca2c2
push idunknown
push userunknown
push dateunknown
bugs805745, 813024
milestone20.0a1
backs out9f6c579151c5c61b9b213d7027633f90238c161c
Backout 9f6c579151c5 (bug 805745) for making bug 813024 worse.
view/src/nsViewManager.cpp
--- a/view/src/nsViewManager.cpp
+++ b/view/src/nsViewManager.cpp
@@ -330,16 +330,21 @@ void nsViewManager::Refresh(nsView *aVie
     nsRect viewRect = aView->GetDimensions();
     nsRect damageRect = damageRegion.GetBounds();
     printf("XXX Damage rectangle (%d,%d,%d,%d) does not intersect the widget's view (%d,%d,%d,%d)!\n",
            damageRect.x, damageRect.y, damageRect.width, damageRect.height,
            viewRect.x, viewRect.y, viewRect.width, viewRect.height);
 #endif
     return;
   }
+
+  if (aView->ForcedRepaint() && IsRefreshDriverPaintingEnabled()) {
+    ProcessPendingUpdates();
+    aView->SetForcedRepaint(false);
+  }
   
   nsIWidget *widget = aView->GetWidget();
   if (!widget) {
     return;
   }
 
   NS_ASSERTION(!IsPainting(), "recursive painting not permitted");
   if (IsPainting()) {
@@ -665,29 +670,16 @@ void nsViewManager::WillPaintWindow(nsIW
     // Flush things like reflows by calling WillPaint on observer presShells.
     nsRefPtr<nsViewManager> rootVM = RootViewManager();
     rootVM->CallWillPaintOnObservers(aWillSendDidPaint);
 
     // Flush view widget geometry updates and invalidations.
     rootVM->ProcessPendingUpdates();
   }
 
-  if (aWidget && IsRefreshDriverPaintingEnabled()) {
-    nsView* view = nsView::GetViewFor(aWidget);
-    if (view && view->ForcedRepaint()) {
-      ProcessPendingUpdates();
-      // Re-get the view pointer here since the ProcessPendingUpdates might have
-      // destroyed it during CallWillPaintOnObservers.
-      view = nsView::GetViewFor(aWidget);
-      if (view) {
-        view->SetForcedRepaint(false);
-      }
-    }
-  }
-
   nsCOMPtr<nsIPresShell> shell = mPresShell;
   if (shell) {
     shell->WillPaintWindow(aWillSendDidPaint);
   }
 }
 
 bool nsViewManager::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion,
                                 uint32_t aFlags)