From 7d7b59dd0b49b4565b7e9c40b0a901b830045ff4 Mon Sep 17 00:00:00 2001 From: Cosmin Sabou Date: Tue, 28 Nov 2017 13:50:59 +0200 Subject: [PATCH] Backed out changeset 423f4e43a975 (bug 1417751) for xpcshell failures at devtools/shared/tests/unit/test_css-properties-db.js r=backout on a CLOSED TREE --- gfx/src/nsThemeConstants.h | 3 -- layout/style/nsCSSKeywordList.h | 1 - layout/style/nsCSSProps.cpp | 1 - widget/cocoa/nsNativeThemeCocoa.mm | 9 ++--- widget/gtk/gtk2drawing.c | 49 ---------------------------- widget/gtk/gtk3drawing.cpp | 38 --------------------- widget/gtk/gtkdrawing.h | 1 - widget/gtk/nsNativeThemeGTK.cpp | 5 --- widget/headless/HeadlessThemeGTK.cpp | 2 -- widget/windows/nsNativeThemeWin.cpp | 9 ----- 10 files changed, 2 insertions(+), 116 deletions(-) diff --git a/gfx/src/nsThemeConstants.h b/gfx/src/nsThemeConstants.h index 0688222ef7ea..439ada6e80a6 100644 --- a/gfx/src/nsThemeConstants.h +++ b/gfx/src/nsThemeConstants.h @@ -135,9 +135,6 @@ enum ThemeWidgetType : uint8_t { // A tooltip NS_THEME_TOOLTIP, - // A inner-spin control - NS_THEME_INNER_SPIN_BUTTON, - // A spin control (up/down control for time/date pickers) NS_THEME_SPINNER, diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index ff448c87b761..f184592ad7c6 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -683,7 +683,6 @@ CSS_KEY(tabpanel, tabpanel) CSS_KEY(tab-scroll-arrow-back, tab_scroll_arrow_back) CSS_KEY(tab-scroll-arrow-forward, tab_scroll_arrow_forward) CSS_KEY(tooltip, tooltip) -CSS_KEY(inner-spin-button, inner_spin_button) CSS_KEY(spinner, spinner) CSS_KEY(spinner-upbutton, spinner_upbutton) CSS_KEY(spinner-downbutton, spinner_downbutton) diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 5c1ab8e8aae3..b7815699afa6 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -786,7 +786,6 @@ const KTableEntry nsCSSProps::kAppearanceKTable[] = { { eCSSKeyword_tab_scroll_arrow_back, NS_THEME_TAB_SCROLL_ARROW_BACK }, { eCSSKeyword_tab_scroll_arrow_forward, NS_THEME_TAB_SCROLL_ARROW_FORWARD }, { eCSSKeyword_tooltip, NS_THEME_TOOLTIP }, - { eCSSKeyword_inner_spin_button, NS_THEME_INNER_SPIN_BUTTON }, { eCSSKeyword_spinner, NS_THEME_SPINNER }, { eCSSKeyword_spinner_upbutton, NS_THEME_SPINNER_UPBUTTON }, { eCSSKeyword_spinner_downbutton, NS_THEME_SPINNER_DOWNBUTTON }, diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index a28340b1d395..927cd7176f91 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2551,11 +2551,9 @@ nsNativeThemeCocoa::DrawWidgetBackground(gfxContext* aContext, eventState, aFrame); break; - case NS_THEME_INNER_SPIN_BUTTON: { - case NS_THEME_SPINNER: - bool isSpinner = (aWidgetType == NS_THEME_SPINNER); + case NS_THEME_SPINNER: { nsIContent* content = aFrame->GetContent(); - if (isSpinner && content->IsHTMLElement()) { + if (content->IsHTMLElement()) { // In HTML the theming for the spin buttons is drawn individually into // their own backgrounds instead of being drawn into the background of // their spinner parent as it is for XUL. @@ -3447,7 +3445,6 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsPresContext* aPresContext, break; } - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: @@ -3832,7 +3829,6 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a case NS_THEME_BUTTON_ARROW_DOWN: case NS_THEME_BUTTON_BEVEL: case NS_THEME_TOOLBARBUTTON: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: @@ -3973,7 +3969,6 @@ nsNativeThemeCocoa::WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType) case NS_THEME_MENUITEM: case NS_THEME_MENUSEPARATOR: case NS_THEME_TOOLTIP: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: diff --git a/widget/gtk/gtk2drawing.c b/widget/gtk/gtk2drawing.c index e7f9d32a4d1c..9b523c8f893e 100644 --- a/widget/gtk/gtk2drawing.c +++ b/widget/gtk/gtk2drawing.c @@ -1365,51 +1365,6 @@ moz_gtk_scrollbar_thumb_paint(WidgetNodeType widget, return MOZ_GTK_SUCCESS; } -static gint -moz_gtk_inner_spin_paint(GdkDrawable* drawable, GdkRectangle* rect, - GtkWidgetState* state, - GtkTextDirection direction) -{ - GdkRectangle arrow_rect; - GtkStateType state_type = ConvertGtkState(state); - GtkShadowType shadow_type = state_type == GTK_STATE_ACTIVE ? - GTK_SHADOW_IN : GTK_SHADOW_OUT; - GtkStyle* style; - - ensure_spin_widget(); - style = gSpinWidget->style; - gtk_widget_set_direction(gSpinWidget, direction); - - TSOffsetStyleGCs(style, rect->x, rect->y); - gtk_paint_box(style, drawable, state_type, shadow_type, NULL, gSpinWidget, - "spinbutton", rect->x, rect->y, rect->width, rect->height); - - /* hard code these values */ - arrow_rect.width = 6; - arrow_rect.height = 6; - - // align spin to the left - arrow_rect.x = rect->x; - - // up button - arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2 - 3; - gtk_paint_arrow(style, drawable, state_type, shadow_type, NULL, - gSpinWidget, "spinbutton", - GTK_ARROW_UP, TRUE, - arrow_rect.x, arrow_rect.y, - arrow_rect.width, arrow_rect.height); - - // down button - arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2 + 3; - gtk_paint_arrow(style, drawable, state_type, shadow_type, NULL, - gSpinWidget, "spinbutton", - GTK_ARROW_DOWN, - arrow_rect.x, arrow_rect.y, - arrow_rect.width, arrow_rect.height); - - return MOZ_GTK_SUCCESS; -} - static gint moz_gtk_spin_paint(GdkDrawable* drawable, GdkRectangle* rect, GtkTextDirection direction) @@ -3029,7 +2984,6 @@ moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top, case MOZ_GTK_TOOLBAR_SEPARATOR: case MOZ_GTK_MENUSEPARATOR: /* These widgets have no borders.*/ - case MOZ_GTK_INNER_SPIN_BUTTON: case MOZ_GTK_SPINBUTTON: case MOZ_GTK_WINDOW: case MOZ_GTK_RESIZER: @@ -3293,9 +3247,6 @@ moz_gtk_widget_paint(WidgetNodeType widget, GdkDrawable* drawable, return moz_gtk_scale_thumb_paint(drawable, rect, cliprect, state, (GtkOrientation) flags, direction); break; - case MOZ_GTK_INNER_SPIN_BUTTON: - return moz_gtk_inner_spin_paint(drawable, rect, state, direction); - break; case MOZ_GTK_SPINBUTTON: return moz_gtk_spin_paint(drawable, rect, direction); break; diff --git a/widget/gtk/gtk3drawing.cpp b/widget/gtk/gtk3drawing.cpp index a3a1478bfe85..2969be818e96 100644 --- a/widget/gtk/gtk3drawing.cpp +++ b/widget/gtk/gtk3drawing.cpp @@ -797,40 +797,6 @@ moz_gtk_scrollbar_thumb_paint(WidgetNodeType widget, return MOZ_GTK_SUCCESS; } -static gint -moz_gtk_inner_spin_paint(cairo_t *cr, GdkRectangle* rect, - GtkWidgetState* state, - GtkTextDirection direction) -{ - GtkStyleContext* style = GetStyleContext(MOZ_GTK_SPINBUTTON, direction, - GetStateFlagsFromGtkWidgetState(state)); - - gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height); - gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height); - - /* hard code these values */ - GdkRectangle arrow_rect; - arrow_rect.width = 6; - arrow_rect.height = 6; - - // align spin to the left - arrow_rect.x = rect->x; - - // up button - arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2 - 3; - gtk_render_arrow(style, cr, ARROW_UP, - arrow_rect.x, arrow_rect.y, - arrow_rect.width); - - // down button - arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2 + 3; - gtk_render_arrow(style, cr, ARROW_DOWN, - arrow_rect.x, arrow_rect.y, - arrow_rect.width); - - return MOZ_GTK_SUCCESS; -} - static gint moz_gtk_spin_paint(cairo_t *cr, GdkRectangle* rect, GtkTextDirection direction) @@ -2317,7 +2283,6 @@ moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top, case MOZ_GTK_TOOLBAR_SEPARATOR: case MOZ_GTK_MENUSEPARATOR: /* These widgets have no borders.*/ - case MOZ_GTK_INNER_SPIN_BUTTON: case MOZ_GTK_SPINBUTTON: case MOZ_GTK_WINDOW: case MOZ_GTK_RESIZER: @@ -2880,9 +2845,6 @@ moz_gtk_widget_paint(WidgetNodeType widget, cairo_t *cr, return moz_gtk_scale_thumb_paint(cr, rect, state, (GtkOrientation) flags, direction); break; - case MOZ_GTK_INNER_SPIN_BUTTON: - return moz_gtk_inner_spin_paint(cr, rect, state, direction); - break; case MOZ_GTK_SPINBUTTON: return moz_gtk_spin_paint(cr, rect, direction); break; diff --git a/widget/gtk/gtkdrawing.h b/widget/gtk/gtkdrawing.h index 4e796d0237d9..59fd1256e22d 100644 --- a/widget/gtk/gtkdrawing.h +++ b/widget/gtk/gtkdrawing.h @@ -175,7 +175,6 @@ typedef enum { MOZ_GTK_SCALE_THUMB_HORIZONTAL, MOZ_GTK_SCALE_THUMB_VERTICAL, /* Paints a GtkSpinButton */ - MOZ_GTK_INNER_SPIN_BUTTON, MOZ_GTK_SPINBUTTON, MOZ_GTK_SPINBUTTON_UP, MOZ_GTK_SPINBUTTON_DOWN, diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index 953aead6cdd4..c38c9e1eed3d 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -439,9 +439,6 @@ nsNativeThemeGTK::GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame, case NS_THEME_SCROLLBARTHUMB_HORIZONTAL: aGtkWidgetType = MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL; break; - case NS_THEME_INNER_SPIN_BUTTON: - aGtkWidgetType = MOZ_GTK_INNER_SPIN_BUTTON; - break; case NS_THEME_SPINNER: aGtkWidgetType = MOZ_GTK_SPINBUTTON; break; @@ -1660,7 +1657,6 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, aResult->width = separator_width; } break; - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: // hard code these sizes aResult->width = 14; @@ -1848,7 +1844,6 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, case NS_THEME_TAB_SCROLL_ARROW_BACK: case NS_THEME_TAB_SCROLL_ARROW_FORWARD: case NS_THEME_TOOLTIP: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: diff --git a/widget/headless/HeadlessThemeGTK.cpp b/widget/headless/HeadlessThemeGTK.cpp index 7f0ce20e3792..f5e43ff4c7d5 100644 --- a/widget/headless/HeadlessThemeGTK.cpp +++ b/widget/headless/HeadlessThemeGTK.cpp @@ -223,7 +223,6 @@ HeadlessThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext, aResult->height = 16; *aIsOverridable = false; break; - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: aResult->width = 14; aResult->height = 26; @@ -359,7 +358,6 @@ HeadlessThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, case NS_THEME_TAB_SCROLL_ARROW_BACK: case NS_THEME_TAB_SCROLL_ARROW_FORWARD: case NS_THEME_TOOLTIP: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp index bd6f76ca3e52..5bbdc3aacc1e 100644 --- a/widget/windows/nsNativeThemeWin.cpp +++ b/widget/windows/nsNativeThemeWin.cpp @@ -682,7 +682,6 @@ nsresult nsNativeThemeWin::GetCachedMinimumWidgetSize(nsIFrame * aFrame, HANDLE aResult->height = sz.cy; switch (aWidgetType) { - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: aResult->width++; @@ -767,7 +766,6 @@ mozilla::Maybe nsNativeThemeWin::GetThemeClass(uint8_t aWidgetTy case NS_THEME_SCALETHUMB_HORIZONTAL: case NS_THEME_SCALETHUMB_VERTICAL: return Some(eUXTrackbar); - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: return Some(eUXSpin); @@ -1145,7 +1143,6 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType, } return NS_OK; } - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: { aPart = (aWidgetType == NS_THEME_SPINNER_UPBUTTON) ? @@ -2721,7 +2718,6 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsIFrame* aFrame, case NS_THEME_SCALETHUMB_HORIZONTAL: case NS_THEME_SCALETHUMB_VERTICAL: case NS_THEME_MENULIST_BUTTON: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: case NS_THEME_LISTBOX: @@ -2877,7 +2873,6 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIFrame* aFrame, (*aResult).width = ::GetSystemMetrics(SM_CXMENUCHECK); (*aResult).height = ::GetSystemMetrics(SM_CYMENUCHECK); break; - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); @@ -3279,7 +3274,6 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t return NS_OK; } - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: { EventStates contentState = GetContentState(aFrame, aWidgetType); @@ -3289,7 +3283,6 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t case NS_THEME_SPINNER_UPBUTTON: aState = DFCS_SCROLLUP; break; - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_DOWNBUTTON: aState = DFCS_SCROLLDOWN; break; @@ -3590,7 +3583,6 @@ RENDER_AGAIN: case NS_THEME_SCROLLBARBUTTON_DOWN: case NS_THEME_SCROLLBARBUTTON_LEFT: case NS_THEME_SCROLLBARBUTTON_RIGHT: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: case NS_THEME_MENULIST_BUTTON: @@ -3995,7 +3987,6 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(uint8_t aWidgetType) case NS_THEME_SCALE_VERTICAL: case NS_THEME_SCALETHUMB_HORIZONTAL: case NS_THEME_SCALETHUMB_VERTICAL: - case NS_THEME_INNER_SPIN_BUTTON: case NS_THEME_SPINNER_UPBUTTON: case NS_THEME_SPINNER_DOWNBUTTON: case NS_THEME_LISTBOX: