Bug 1498356 - Remove padding/border from -moz-window-titlebar*, r=dao
authorMartin Stransky <stransky@redhat.com>
Fri, 12 Oct 2018 16:16:57 +0000
changeset 499382 3df978f11b6d4017d88295335458283c38d697cd
parent 499381 a0d97137f1d6686476466a57e0fcba6451663a09
child 499383 d2b32aa2055fecc143a03013b06afbac1ad91836
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1498356
milestone64.0a1
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
Bug 1498356 - Remove padding/border from -moz-window-titlebar*, r=dao Differential Revision: https://phabricator.services.mozilla.com/D8529
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -2330,18 +2330,16 @@ moz_gtk_info_bar_paint(cairo_t *cr, GdkR
 static gint
 moz_gtk_header_bar_paint(WidgetNodeType widgetType,
                          cairo_t *cr, GdkRectangle* rect, GtkWidgetState* state)
 {
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
     GtkStyleContext *style =
         GetStyleContext(widgetType, GTK_TEXT_DIR_NONE, state_flags);
 
-    InsetByMargin(rect, style);
-
     // Some themes (Adwaita for instance) draws bold dark line at
     // titlebar bottom. It does not fit well with Firefox tabs so
     // draw with some extent to make the titlebar bottom part invisible.
     #define TITLEBAR_EXTENT 4
 
     // We don't need to draw window decoration for MOZ_GTK_HEADER_BAR_MAXIMIZED,
     // i.e. when main window is maximized.
     if (widgetType == MOZ_GTK_HEADER_BAR) {
@@ -2568,24 +2566,16 @@ moz_gtk_get_widget_border(WidgetNodeType
                                               left, top, right, bottom);
 
             GtkStyleContext* labelStyle = GetStyleContext(MOZ_GTK_TOOLTIP_BOX_LABEL);
             moz_gtk_add_margin_border_padding(labelStyle,
                                               left, top, right, bottom);
 
             return MOZ_GTK_SUCCESS;
         }
-    case MOZ_GTK_HEADER_BAR:
-    case MOZ_GTK_HEADER_BAR_MAXIMIZED:
-        {
-            style = GetStyleContext(widget);
-            moz_gtk_add_border_padding(style, left, top, right, bottom);
-            *top = *bottom = 0;
-            return MOZ_GTK_SUCCESS;
-        }
     /* These widgets have no borders, since they are not containers. */
     case MOZ_GTK_CHECKBUTTON_LABEL:
     case MOZ_GTK_RADIOBUTTON_LABEL:
     case MOZ_GTK_SPLITTER_HORIZONTAL:
     case MOZ_GTK_SPLITTER_VERTICAL:
     case MOZ_GTK_CHECKBUTTON:
     case MOZ_GTK_RADIOBUTTON:
     case MOZ_GTK_SCROLLBAR_BUTTON:
@@ -2595,16 +2585,18 @@ moz_gtk_get_widget_border(WidgetNodeType
     case MOZ_GTK_SCALE_THUMB_VERTICAL:
     case MOZ_GTK_GRIPPER:
     case MOZ_GTK_PROGRESS_CHUNK:
     case MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE:
     case MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE:
     case MOZ_GTK_TREEVIEW_EXPANDER:
     case MOZ_GTK_TOOLBAR_SEPARATOR:
     case MOZ_GTK_MENUSEPARATOR:
+    case MOZ_GTK_HEADER_BAR:
+    case MOZ_GTK_HEADER_BAR_MAXIMIZED:
     case MOZ_GTK_HEADER_BAR_BUTTON_CLOSE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MINIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE:
     case MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE_RESTORE:
     /* These widgets have no borders.*/
     case MOZ_GTK_INNER_SPIN_BUTTON:
     case MOZ_GTK_SPINBUTTON:
     case MOZ_GTK_WINDOW: