Back out bug 1000875 in order to fix the regression tracked in bug 1011166. a=backout
authorMarkus Stange <mstange@themasta.com>
Thu, 21 Aug 2014 21:55:26 +0200
changeset 208368 11a5306111d0
parent 208367 53d300e03f5b
child 208369 ac8864d8ecc0
push id3844
push usermstange@themasta.com
push date2014-08-21 19:55 +0000
treeherdermozilla-beta@11a5306111d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1000875, 1011166
milestone32.0
Back out bug 1000875 in order to fix the regression tracked in bug 1011166. a=backout
dom/base/nsDOMWindowUtils.cpp
gfx/layers/client/ContentClient.cpp
layout/base/FrameLayerBuilder.cpp
layout/base/nsDisplayList.cpp
layout/base/tests/chrome/test_fixed_bg_scrolling_repaints.html
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2882,27 +2882,16 @@ nsDOMWindowUtils::CheckAndClearPaintedSt
 
   nsIFrame* frame = content->GetPrimaryFrame();
 
   if (!frame) {
     *aResult = false;
     return NS_OK;
   }
 
-  // Get the outermost frame for the content node, so that we can test
-  // canvasframe invalidations by observing the documentElement.
-  for (;;) {
-    nsIFrame* parentFrame = frame->GetParent();
-    if (parentFrame && parentFrame->GetContent() == content) {
-      frame = parentFrame;
-    } else {
-      break;
-    }
-  }
-
   *aResult = frame->CheckAndClearPaintedState();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::EnableDialogs()
 {
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -23,17 +23,16 @@
 #include "mozilla/layers/LayerManagerComposite.h"
 #include "mozilla/layers/LayersMessages.h"  // for ThebesBufferData
 #include "mozilla/layers/LayersTypes.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsDebug.h"                    // for NS_ASSERTION, NS_WARNING, etc
 #include "nsISupportsImpl.h"            // for gfxContext::Release, etc
 #include "nsIWidget.h"                  // for nsIWidget
 #include "prenv.h"                      // for PR_GetEnv
-#include "nsLayoutUtils.h"
 #ifdef XP_WIN
 #include "gfxWindowsPlatform.h"
 #endif
 #include "gfx2DGlue.h"
 
 namespace mozilla {
 
 using namespace gfx;
@@ -684,27 +683,16 @@ ContentClientIncremental::BeginPaintBuff
       // We need to validate the entire buffer, to make sure that only valid
       // pixels are sampled
       neededRegion = destBufferRect;
     }
 
     if (mHasBuffer &&
         (mContentType != contentType ||
          (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) != mHasBufferOnWhite)) {
-#ifdef MOZ_DUMP_PAINTING
-      if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
-        if (mContentType != contentType) {
-          printf_stderr("Layer's content type has changed\n");
-        }
-        if ((mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) != mHasBufferOnWhite) {
-          printf_stderr("Layer's component alpha status has changed\n");
-        }
-        printf_stderr("Invalidating entire layer %p\n", aLayer);
-      }
-#endif
       // We're effectively clearing the valid region, so we need to draw
       // the entire needed region now.
       result.mRegionToInvalidate = aLayer->GetValidRegion();
       validRegion.SetEmpty();
       mHasBuffer = false;
       mHasBufferOnWhite = false;
       mBufferRect.SetRect(0, 0, 0, 0);
       mBufferRotation.MoveTo(0, 0);
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1988,25 +1988,16 @@ ContainerState::PopThebesLayerData()
 
     // Store the background color
     ThebesDisplayItemLayerUserData* userData =
       GetThebesDisplayItemLayerUserData(data->mLayer);
     NS_ASSERTION(userData, "where did our user data go?");
     if (userData->mForcedBackgroundColor != backgroundColor) {
       // Invalidate the entire target ThebesLayer since we're changing
       // the background color
-#ifdef MOZ_DUMP_PAINTING
-      if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
-        printf_stderr("Forced background color has changed from #%08X to #%08X on layer %p\n",
-                      userData->mForcedBackgroundColor, backgroundColor, data->mLayer);
-        nsAutoCString str;
-        AppendToString(str, data->mLayer->GetValidRegion());
-        printf_stderr("Invalidating layer %p: %s\n", data->mLayer, str.get());
-      }
-#endif
       data->mLayer->InvalidateRegion(data->mLayer->GetValidRegion());
     }
     userData->mForcedBackgroundColor = backgroundColor;
 
     // use a mask layer for rounded rect clipping.
     // data->mCommonClipCount may be -1 if we haven't put any actual
     // drawable items in this layer (i.e. it's only catching events).
     int32_t commonClipCount = std::max(0, data->mCommonClipCount);
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2194,38 +2194,32 @@ nsDisplayBackgroundImage::GetInsideClipR
   if (aRect.IsEmpty())
     return result;
 
   nsIFrame *frame = aItem->Frame();
 
   nscoord radii[8];
   nsRect clipRect;
   bool haveRadii;
-  if (frame->GetType() == nsGkAtoms::canvasFrame) {
-    nsCanvasFrame* canvasFrame = static_cast<nsCanvasFrame*>(frame);
-    haveRadii = false;
-    clipRect = canvasFrame->CanvasArea() + aItem->ToReferenceFrame();
-  } else {
-    switch (aClip) {
-    case NS_STYLE_BG_CLIP_BORDER:
-      haveRadii = frame->GetBorderRadii(radii);
-      clipRect = nsRect(aItem->ToReferenceFrame(), frame->GetSize());
-      break;
-    case NS_STYLE_BG_CLIP_PADDING:
-      haveRadii = frame->GetPaddingBoxBorderRadii(radii);
-      clipRect = frame->GetPaddingRect() - frame->GetPosition() + aItem->ToReferenceFrame();
-      break;
-    case NS_STYLE_BG_CLIP_CONTENT:
-      haveRadii = frame->GetContentBoxBorderRadii(radii);
-      clipRect = frame->GetContentRect() - frame->GetPosition() + aItem->ToReferenceFrame();
-      break;
-    default:
-      NS_NOTREACHED("Unknown clip type");
-      return result;
-    }
+  switch (aClip) {
+  case NS_STYLE_BG_CLIP_BORDER:
+    haveRadii = frame->GetBorderRadii(radii);
+    clipRect = nsRect(aItem->ToReferenceFrame(), frame->GetSize());
+    break;
+  case NS_STYLE_BG_CLIP_PADDING:
+    haveRadii = frame->GetPaddingBoxBorderRadii(radii);
+    clipRect = frame->GetPaddingRect() - frame->GetPosition() + aItem->ToReferenceFrame();
+    break;
+  case NS_STYLE_BG_CLIP_CONTENT:
+    haveRadii = frame->GetContentBoxBorderRadii(radii);
+    clipRect = frame->GetContentRect() - frame->GetPosition() + aItem->ToReferenceFrame();
+    break;
+  default:
+    NS_NOTREACHED("Unknown clip type");
+    return result;
   }
 
   if (haveRadii) {
     *aSnap = false;
     result = nsLayoutUtils::RoundedRectIntersectRect(clipRect, radii, aRect);
   } else {
     result = clipRect.Intersect(aRect);
   }
--- a/layout/base/tests/chrome/test_fixed_bg_scrolling_repaints.html
+++ b/layout/base/tests/chrome/test_fixed_bg_scrolling_repaints.html
@@ -2,40 +2,35 @@
 <html>
 <head>
   <title>Test that we don't get unnecessary repaints with fixed backgrounds</title>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
 </head>
 <!-- Need a timeout here to allow paint unsuppression before we start the test -->
-<body onload="setTimeout(startTest,0)" style="background:url(blue-32x32.png) top left no-repeat fixed; background-size: 100px 2000px; overflow:hidden;">
+<body onload="setTimeout(startTest,0)" style="background: url(blue-32x32.png) fixed">
 <div style="height: 2048px"></div>
-
 <pre id="test">
 <script type="application/javascript">
 SimpleTest.waitForExplicitFinish();
 
 var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
                getInterface(Components.interfaces.nsIDOMWindowUtils);
 
 function startTest() {
   // Do a scroll to ensure we trigger activity heuristics.
-  document.documentElement.scrollTop = 1;
   waitForAllPaintsFlushed(function () {
-    document.documentElement.scrollTop = 0;
+    // Clear paint state and scroll down
+    utils.checkAndClearPaintedState(document.body);
+    document.documentElement.scrollTop = 100;
     waitForAllPaintsFlushed(function () {
-      // Clear paint state and scroll down
-      utils.checkAndClearPaintedState(document.documentElement);
-      document.documentElement.scrollTop = 100;
-      waitForAllPaintsFlushed(function () {
-        // Make sure nothing painted
-        var painted = utils.checkAndClearPaintedState(document.documentElement);
-        is(painted, false, "Fixed background should not have been painted when scrolled");
-        SimpleTest.finish();
-      });
+      // Make sure the body didn't paint
+      var painted = utils.checkAndClearPaintedState(document.body);
+      is(painted, false, "Fixed background should not have been painted when scrolled");
+      SimpleTest.finish();
     });
   });
 }
 </script>
 </pre>
 </body>
 </html>