Backed out changeset b097bd9fd24c because of Windows build bustage
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 19 May 2013 11:29:19 -0400
changeset 132348 70898c96cceb244743bcd8c381e6f2c449cd84c5
parent 132347 b097bd9fd24cc151c722f44695092ad3bce53fd4
child 132349 ec0d43b4533d2fe72f0f05120a3e96df4a96e564
push id28224
push usereakhgari@mozilla.com
push dateSun, 19 May 2013 15:29:26 +0000
treeherdermozilla-inbound@70898c96cceb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone24.0a1
backs outb097bd9fd24cc151c722f44695092ad3bce53fd4
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
Backed out changeset b097bd9fd24c because of Windows build bustage
widget/cocoa/nsNativeThemeCocoa.mm
widget/xpwidgets/Makefile.in
widget/xpwidgets/nsNativeTheme.cpp
widget/xpwidgets/nsNativeTheme.h
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2302,24 +2302,24 @@ nsNativeThemeCocoa::DrawWidgetBackground
           if (isHorizontal) {
             macRect.origin.y += 4;
             macRect.size.height -= 4;
           } else {
             macRect.origin.x += 4;
             macRect.size.width -= 4;
           }
         }
-        const BOOL isOnTopOfDarkBackground = IsDarkBackground(aFrame);
+        const BOOL isOnTopOfBrightBackground = YES; // TODO: detect this properly
         CUIDraw([NSWindow coreUIRenderer], macRect, cgContext,
                 (CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
                   @"kCUIWidgetOverlayScrollBar", @"widget",
                   @"regular", @"size",
                   (isRolledOver ? @"rollover" : @""), @"state",
                   (isHorizontal ? @"kCUIOrientHorizontal" : @"kCUIOrientVertical"), @"kCUIOrientationKey",
-                  (isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey",
+                  (isOnTopOfBrightBackground ? @"" : @"kCUIVariantWhite"), @"kCUIVariantKey",
                   [NSNumber numberWithBool:YES], @"indiconly",
                   [NSNumber numberWithBool:YES], @"kCUIThumbProportionKey",
                   [NSNumber numberWithBool:YES], @"is.flipped",
                   nil],
                 nil);
       }
       break;
     case NS_THEME_SCROLLBAR_BUTTON_UP:
@@ -2337,23 +2337,23 @@ nsNativeThemeCocoa::DrawWidgetBackground
 #endif
     break;
     case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
     case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
       if (nsLookAndFeel::GetInt(
             nsLookAndFeel::eIntID_UseOverlayScrollbars) != 0 &&
           CheckBooleanAttr(GetParentScrollbarFrame(aFrame), nsGkAtoms::hover)) {
         BOOL isHorizontal = (aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL);
-        const BOOL isOnTopOfDarkBackground = IsDarkBackground(aFrame);
+        const BOOL isOnTopOfBrightBackground = YES; // TODO: detect this properly
         CUIDraw([NSWindow coreUIRenderer], macRect, cgContext,
                 (CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
                   @"kCUIWidgetOverlayScrollBar", @"widget",
                   @"regular", @"size",
                   (isHorizontal ? @"kCUIOrientHorizontal" : @"kCUIOrientVertical"), @"kCUIOrientationKey",
-                  (isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey",
+                  (isOnTopOfBrightBackground ? @"" : @"kCUIVariantWhite"), @"kCUIVariantKey",
                   [NSNumber numberWithBool:YES], @"noindicator",
                   [NSNumber numberWithBool:YES], @"kCUIThumbProportionKey",
                   [NSNumber numberWithBool:YES], @"is.flipped",
                   nil],
                 nil);
       }
       break;
 
--- a/widget/xpwidgets/Makefile.in
+++ b/widget/xpwidgets/Makefile.in
@@ -66,17 +66,16 @@ endif
 
 ifdef MOZ_ENABLE_D3D10_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D10_LAYER
 endif
 
 LOCAL_INCLUDES	+= \
 		-I$(srcdir)/../$(MOZ_WIDGET_TOOLKIT) \
 		-I$(srcdir)/../shared \
-		-I$(topsrcdir)/layout/base \
 		-I$(topsrcdir)/layout/forms \
 		-I$(topsrcdir)/layout/generic \
 		-I$(topsrcdir)/layout/xul/base/src \
 		-I$(topsrcdir)/view/src \
 		-I$(srcdir) \
 		$(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
--- a/widget/xpwidgets/nsNativeTheme.cpp
+++ b/widget/xpwidgets/nsNativeTheme.cpp
@@ -18,17 +18,16 @@
 #include "nsIDOMXULMenuListElement.h"
 #include "nsThemeConstants.h"
 #include "nsIComponentManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsProgressFrame.h"
 #include "nsMeterFrame.h"
 #include "nsMenuFrame.h"
 #include "nsRangeFrame.h"
-#include "nsCSSRendering.h"
 #include "mozilla/dom/Element.h"
 #include <algorithm>
 
 nsNativeTheme::nsNativeTheme()
 : mAnimatedContentTimeout(UINT32_MAX)
 {
 }
 
@@ -673,29 +672,8 @@ nsNativeTheme::IsRangeHorizontal(nsIFram
   nsIFrame* rangeFrame = aFrame;
   if (rangeFrame->GetType() != nsGkAtoms::rangeFrame) {
     rangeFrame = aFrame->GetParent();
   }
   MOZ_ASSERT(rangeFrame->GetType() == nsGkAtoms::rangeFrame);
 
   return static_cast<nsRangeFrame*>(rangeFrame)->IsHorizontal();
 }
-
-bool
-nsNativeTheme::IsDarkBackground(nsIFrame* aFrame)
-{
-  nsIScrollableFrame* scrollFrame = aFrame->GetScrollTargetFrame();
-  while (!scrollFrame && aFrame) {
-    aFrame = aFrame->GetParent();
-    scrollFrame = aFrame->GetScrollTargetFrame();
-  }
-  nsIFrame* frame = scrollFrame->GetScrolledFrame();
-  nsStyleContext* bgSC;
-  if (nsCSSRendering::FindBackground(frame, &bgSC)) {
-    nscolor bgColor = bgSC->StyleBackground()->mBackgroundColor;
-    // Consider the background color dark if the sum of the r, g and b values is
-    // less than 384 in a semi-transparent docement.  This heuristic matches what
-    // WebKit does, and we can improve it later if needed.
-    return NS_GET_A(bgColor) > 127 &&
-           NS_GET_R(bgColor) + NS_GET_G(bgColor) + NS_GET_B(bgColor) < 384;
-  }
-  return false;
-}
--- a/widget/xpwidgets/nsNativeTheme.h
+++ b/widget/xpwidgets/nsNativeTheme.h
@@ -168,16 +168,13 @@ class nsNativeTheme : public nsITimerCal
   bool QueueAnimatedContentForRefresh(nsIContent* aContent,
                                         uint32_t aMinimumFrameRate);
 
   nsIFrame* GetAdjacentSiblingFrameWithSameAppearance(nsIFrame* aFrame,
                                                       bool aNextSibling);
 
   bool IsRangeHorizontal(nsIFrame* aFrame);
 
-  // scrollbar
-  bool IsDarkBackground(nsIFrame* aFrame);
-
  private:
   uint32_t mAnimatedContentTimeout;
   nsCOMPtr<nsITimer> mAnimatedContentTimer;
   nsAutoTArray<nsCOMPtr<nsIContent>, 20> mAnimatedContentList;
 };