Back out a38f82d29d97 (bug 652914) for causing reftest failures.
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 06 Sep 2011 15:19:31 -0500
changeset 77931 dc30ee4aca217511caac2422ea483da6deed6b3b
parent 77930 4fe3fb96bd377b4b0795c7dcff7ea0d3cbbd1afe
child 77932 f76296e27bcbc4b51d67f830b3f194e33b6b71c6
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs652914
milestone9.0a1
backs outa38f82d29d97475d6227285b93af80eafeed32a4
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out a38f82d29d97 (bug 652914) for causing reftest failures.
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRendering.h
layout/base/nsPresShell.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -1695,22 +1695,22 @@ DrawBackgroundColor(BackgroundClipState&
 
   aCtx->NewPath();
   aCtx->RoundedRectangle(bgAreaGfx, aClipState.mClippedRadii,
                          aClipState.mRadiiAreOuter);
   aCtx->Fill();
   aCtx->Restore();
 }
 
-nscolor
-nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
-                                         nsStyleContext* aStyleContext,
-                                         nsIFrame* aFrame,
-                                         PRBool& aDrawBackgroundImage,
-                                         PRBool& aDrawBackgroundColor)
+static nscolor
+DetermineBackgroundColorInternal(nsPresContext* aPresContext,
+                                 nsStyleContext* aStyleContext,
+                                 nsIFrame* aFrame,
+                                 PRBool& aDrawBackgroundImage,
+                                 PRBool& aDrawBackgroundColor)
 {
   aDrawBackgroundImage = PR_TRUE;
   aDrawBackgroundColor = PR_TRUE;
 
   if (aFrame->HonorPrintBackgroundSettings()) {
     aDrawBackgroundImage = aPresContext->GetBackgroundImageDraw();
     aDrawBackgroundColor = aPresContext->GetBackgroundColorDraw();
   }
@@ -1732,16 +1732,30 @@ nsCSSRendering::DetermineBackgroundColor
       aDrawBackgroundColor = PR_TRUE;
     else
       bgColor = NS_RGBA(0,0,0,0);
   }
 
   return bgColor;
 }
 
+nscolor
+nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
+                                         nsStyleContext* aStyleContext,
+                                         nsIFrame* aFrame)
+{
+  PRBool drawBackgroundImage;
+  PRBool drawBackgroundColor;
+  return DetermineBackgroundColorInternal(aPresContext,
+                                          aStyleContext,
+                                          aFrame,
+                                          drawBackgroundImage,
+                                          drawBackgroundColor);
+}
+
 static gfxFloat
 ConvertGradientValueToPixels(const nsStyleCoord& aCoord,
                              gfxFloat aFillLength,
                              PRInt32 aAppUnitsPerPixel)
 {
   switch (aCoord.GetUnit()) {
     case eStyleUnit_Percent:
       return aCoord.GetPercentValue() * aFillLength;
@@ -2299,21 +2313,21 @@ nsCSSRendering::PaintBackgroundWithSC(ns
   // paint the background color here.
   PRBool isCanvasFrame = IsCanvasFrame(aForFrame);
 
   // Determine whether we are drawing background images and/or
   // background colors.
   PRBool drawBackgroundImage;
   PRBool drawBackgroundColor;
 
-  nscolor bgColor = DetermineBackgroundColor(aPresContext,
-                                             aBackgroundSC,
-                                             aForFrame,
-                                             drawBackgroundImage,
-                                             drawBackgroundColor);
+  nscolor bgColor = DetermineBackgroundColorInternal(aPresContext,
+                                                     aBackgroundSC,
+                                                     aForFrame,
+                                                     drawBackgroundImage,
+                                                     drawBackgroundColor);
 
   // At this point, drawBackgroundImage and drawBackgroundColor are
   // true if and only if we are actually supposed to paint an image or
   // color into aDirtyRect, respectively.
   if (!drawBackgroundImage && !drawBackgroundColor)
     return;
 
   // Compute the outermost boundary of the area that might be painted.
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -206,19 +206,17 @@ struct nsCSSRendering {
                                     PRBool aStartAtParent = PR_FALSE);
 
   /**
    * Determine the background color to draw taking into account print settings.
    */
   static nscolor
   DetermineBackgroundColor(nsPresContext* aPresContext,
                            nsStyleContext* aStyleContext,
-                           nsIFrame* aFrame,
-                           PRBool& aDrawBackgroundImage,
-                           PRBool& aDrawBackgroundColor);
+                           nsIFrame* aFrame);
 
   /**
    * Render the background for an element using css rendering rules
    * for backgrounds.
    */
   enum {
     /**
      * When this flag is passed, the element's nsDisplayBorder will be
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -5841,24 +5841,20 @@ void PresShell::UpdateCanvasBackground()
   nsIFrame* rootStyleFrame = FrameConstructor()->GetRootElementStyleFrame();
   if (rootStyleFrame) {
     nsStyleContext* bgStyle =
       nsCSSRendering::FindRootFrameBackground(rootStyleFrame);
     // XXX We should really be passing the canvasframe, not the root element
     // style frame but we don't have access to the canvasframe here. It isn't
     // a problem because only a few frames can return something other than true
     // and none of them would be a canvas frame or root element style frame.
-    PRBool drawBackgroundImage;
-    PRBool drawBackgroundColor;
     mCanvasBackgroundColor =
       nsCSSRendering::DetermineBackgroundColor(mPresContext, bgStyle,
-                                               rootStyleFrame,
-                                               drawBackgroundImage,
-                                               drawBackgroundColor);
-    if (drawBackgroundColor && GetPresContext()->IsRootContentDocument() &&
+                                               rootStyleFrame);
+    if (GetPresContext()->IsRootContentDocument() &&
         !IsTransparentContainerElement(mPresContext)) {
       mCanvasBackgroundColor =
         NS_ComposeColors(mPresContext->DefaultBackgroundColor(), mCanvasBackgroundColor);
     }
   }
 
   // If the root element of the document (ie html) has style 'display: none'
   // then the document's background color does not get drawn; cache the