Backing out bug 889085 (dddfd63f1414, f8c14bd80676) due to regression bug 987783. r=roc, a=sledru
authorMike Kaply <mozilla@kaply.com>
Wed, 02 Apr 2014 10:03:08 -0500
changeset 183646 51e5b0ec21b3
parent 183645 9933fa36efa5
child 183647 fe5d67aa5366
push id3434
push userryanvm@gmail.com
push date2014-04-07 16:57 +0000
Treeherderresults
reviewersroc, sledru
bugs889085, 987783
milestone29.0
Backing out bug 889085 (dddfd63f1414, f8c14bd80676) due to regression bug 987783. r=roc, a=sledru
layout/base/nsCSSRendering.cpp
widget/cocoa/nsNativeThemeCocoa.h
widget/cocoa/nsNativeThemeCocoa.mm
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -1710,22 +1710,16 @@ DrawBackgroundColor(BackgroundClipState&
 
 nscolor
 nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
                                          nsStyleContext* aStyleContext,
                                          nsIFrame* aFrame,
                                          bool& aDrawBackgroundImage,
                                          bool& aDrawBackgroundColor)
 {
-  if (aFrame->IsThemed()) {
-    aDrawBackgroundColor = false;
-    aDrawBackgroundImage = false;
-    return NS_RGBA(0,0,0,0);
-  }
-
   aDrawBackgroundImage = true;
   aDrawBackgroundColor = true;
 
   if (aFrame->HonorPrintBackgroundSettings()) {
     aDrawBackgroundImage = aPresContext->GetBackgroundImageDraw();
     aDrawBackgroundColor = aPresContext->GetBackgroundColorDraw();
   }
 
--- a/widget/cocoa/nsNativeThemeCocoa.h
+++ b/widget/cocoa/nsNativeThemeCocoa.h
@@ -66,17 +66,16 @@ public:
                     double inValue, double inMaxValue, nsIFrame* aFrame);
 
 protected:  
 
   nsIntMargin RTLAwareMargin(const nsIntMargin& aMargin, nsIFrame* aFrame);
   nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);
   CGRect SeparatorAdjustedRect(CGRect aRect, nsIFrame* aLeft,
                                nsIFrame* aCurrent, nsIFrame* aRight);
-  bool IsWindowSheet(nsIFrame* aFrame);
 
   // HITheme drawing routines
   void DrawFrame(CGContextRef context, HIThemeFrameKind inKind,
                  const HIRect& inBoxRect, bool inReadOnly,
                  nsEventStates inState);
   void DrawMeter(CGContextRef context, const HIRect& inBoxRect,
                  nsIFrame* aFrame);
   void DrawSegment(CGContextRef cgContext, const HIRect& inBoxRect,
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2095,24 +2095,17 @@ nsNativeThemeCocoa::DrawWidgetBackground
   //CGContextSetRGBFillColor(cgContext, 0.0, 0.0, 1.0, 0.1);
   //CGContextFillRect(cgContext, bounds);
 #endif
 
   nsEventStates eventState = GetContentState(aFrame, aWidgetType);
 
   switch (aWidgetType) {
     case NS_THEME_DIALOG: {
-      CGContextClearRect(cgContext, macRect);
-      if (IsWindowSheet(aFrame)) {
-        HIThemeSetFill(kThemeBrushSheetBackgroundTransparent, NULL, cgContext, HITHEME_ORIENTATION);
-      }
-      else {
-        HIThemeSetFill(kThemeBrushDialogBackgroundActive, NULL, cgContext, HITHEME_ORIENTATION);
-      }
-
+      HIThemeSetFill(kThemeBrushDialogBackgroundActive, NULL, cgContext, HITHEME_ORIENTATION);
       CGContextFillRect(cgContext, macRect);
     }
       break;
 
     case NS_THEME_MENUPOPUP: {
       HIThemeMenuDrawInfo mdi;
       memset(&mdi, 0, sizeof(mdi));
       mdi.version = 0;
@@ -3357,41 +3350,24 @@ nsNativeThemeCocoa::WidgetAppearanceDepe
     case NS_THEME_LISTBOX:
     case NS_THEME_RESIZER:
       return false;
     default:
       return true;
   }
 }
 
-bool
-nsNativeThemeCocoa::IsWindowSheet(nsIFrame* aFrame)
-{
-  NSWindow* win = NativeWindowForFrame(aFrame);
-  id winDelegate = [win delegate];
-  nsIWidget* widget = [(WindowDelegate *)winDelegate geckoWidget];
-  if (!widget) {
-    return false;
-  }
-  nsWindowType windowType;
-  widget->GetWindowType(windowType);
-  return (windowType == eWindowType_sheet);
-}
-
 nsITheme::Transparency
 nsNativeThemeCocoa::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
 {
   switch (aWidgetType) {
   case NS_THEME_MENUPOPUP:
   case NS_THEME_TOOLTIP:
     return eTransparent;
 
-  case NS_THEME_DIALOG:
-    return IsWindowSheet(aFrame) ? eTransparent : eOpaque;
-
   case NS_THEME_SCROLLBAR_SMALL:
   case NS_THEME_SCROLLBAR:
     return nsLookAndFeel::UseOverlayScrollbars() ? eTransparent : eOpaque;
 
   case NS_THEME_STATUSBAR:
     // Knowing that scrollbars and statusbars are opaque improves
     // performance, because we create layers for them.
     return eOpaque;