Bug 798245 - Postpone firstpaint while painting supressed. r=cjones, a=blocking-basecamp
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Mon, 10 Dec 2012 13:53:53 -0500
changeset 118874 c999276c8c1855d088fd85a2d3ba5162262c4234
parent 118873 c64e8462a68ba5381495edc027107ba03cd203d4
child 118875 4dba9c208e9aa5f57b894708f0f562807bcdee38
push idunknown
push userunknown
push dateunknown
reviewerscjones, blocking-basecamp
bugs798245
milestone19.0a2
Bug 798245 - Postpone firstpaint while painting supressed. r=cjones, a=blocking-basecamp Currently if we are asked to paint while the painting is supressed, we'll still send the firstpaint notification. We currently, rely on first paint to setup the viewport so we won't to postpone it till we're likely to have the information we need.
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -5260,17 +5260,22 @@ PresShell::Paint(nsIView*        aViewTo
 
   nsIFrame* frame = aViewToPaint->GetFrame();
 
   bool isRetainingManager;
   LayerManager* layerManager =
     aViewToPaint->GetWidget()->GetLayerManager(&isRetainingManager);
   NS_ASSERTION(layerManager, "Must be in paint event");
 
-  if (mIsFirstPaint) {
+  // Whether or not we should set first paint when painting is
+  // suppressed is debatable. For now we'll do it because
+  // B2G relies on first paint to configure the viewport and
+  // we only want to do that when we have real content to paint.
+  // See Bug 798245
+  if (mIsFirstPaint && !mPaintingSuppressed) {
     layerManager->SetIsFirstPaint();
     mIsFirstPaint = false;
   }
 
   if (frame && isRetainingManager) {
     // Try to do an empty transaction, if the frame tree does not
     // need to be updated. Do not try to do an empty transaction on
     // a non-retained layer manager (like the BasicLayerManager that