Backed out changeset 83021e7eb511 (bug 1319650) for various form styling issues on Linux. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 01 Dec 2016 22:39:20 +0100
changeset 325050 6368fb6d8a0918a8c9702eec952c75766965fdf9
parent 325049 58e2fd0bf04d4e37265b9ba231bf2b85c916d2de
child 325051 a63ed01b4c5632a96dc0a626400b5251235c5c5f
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbackout
bugs1319650
milestone53.0a1
backs out83021e7eb5115e6976e5da6337ed747595a8a4fb
Backed out changeset 83021e7eb511 (bug 1319650) for various form styling issues on Linux. r=backout
widget/gtk/WidgetStyleCache.cpp
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/WidgetStyleCache.cpp
+++ b/widget/gtk/WidgetStyleCache.cpp
@@ -992,23 +992,16 @@ GetWidgetStyleInternal(WidgetNodeType aN
       return GetWidgetStyleWithClass(MOZ_GTK_RADIOMENUITEM,
                                      GTK_STYLE_CLASS_RADIO);
     case MOZ_GTK_CHECKMENUITEM_INDICATOR:
       return GetWidgetStyleWithClass(MOZ_GTK_CHECKMENUITEM,
                                      GTK_STYLE_CLASS_CHECK);
     case MOZ_GTK_PROGRESS_TROUGH:
       return GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR,
                                      GTK_STYLE_CLASS_TROUGH);
-    case MOZ_GTK_PROGRESS_CHUNK: {
-      GtkStyleContext* style =
-        GetWidgetStyleWithClass(MOZ_GTK_PROGRESSBAR,
-                                GTK_STYLE_CLASS_PROGRESSBAR);
-      gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
-      return style;
-    }
     case MOZ_GTK_GRIPPER:
       return GetWidgetStyleWithClass(MOZ_GTK_GRIPPER,
                                      GTK_STYLE_CLASS_GRIP);
     case MOZ_GTK_INFO_BAR:
       return GetWidgetStyleWithClass(MOZ_GTK_INFO_BAR,
                                      GTK_STYLE_CLASS_INFO);
     case MOZ_GTK_SPINBUTTON_ENTRY:
       return GetWidgetStyleWithClass(MOZ_GTK_SPINBUTTON,
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -1371,18 +1371,27 @@ moz_gtk_progressbar_paint(cairo_t *cr, G
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_progress_chunk_paint(cairo_t *cr, GdkRectangle* rect,
                              GtkTextDirection direction,
                              WidgetNodeType widget)
 {
-    GtkStyleContext* style =
-        ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction);
+    GtkStyleContext* style;
+
+    if (gtk_check_version(3, 20, 0) != nullptr) {
+      /* Ask for MOZ_GTK_PROGRESS_TROUGH instead of MOZ_GTK_PROGRESSBAR
+       * because ClaimStyleContext() saves/restores that style */
+      style = ClaimStyleContext(MOZ_GTK_PROGRESS_TROUGH, direction);
+      gtk_style_context_remove_class(style, GTK_STYLE_CLASS_TROUGH);
+      gtk_style_context_add_class(style, GTK_STYLE_CLASS_PROGRESSBAR);
+    } else {
+      style = ClaimStyleContext(MOZ_GTK_PROGRESS_CHUNK, direction);
+    }
 
     if (widget == MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE ||
         widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE) {
       /**
        * The bar's size and the bar speed are set depending of the progress'
        * size. These could also be constant for all progress bars easily.
        */
       gboolean vertical = (widget == MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE);