Backed out changeset dceea26b46ae (bug 1319650)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 01 Dec 2016 22:38:32 +0100
changeset 325048 78e5f82eb83aad9c34c047f63927cbf5b1143a1f
parent 325047 7068e81c96ae3c61940313fef3835afff3829fcc
child 325049 58e2fd0bf04d4e37265b9ba231bf2b85c916d2de
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1319650
milestone53.0a1
backs outdceea26b46aecc0920f44128cde85539107b4dd0
Backed out changeset dceea26b46ae (bug 1319650)
widget/gtk/gtk3drawing.cpp
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -1510,18 +1510,18 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
              *           :    ^       bmargin          :  ^
              *           :    | (-negative margin,     :  |
              *  bottom   :    v  passed in flags)      :  |       gap_height
              *    of  -> :.............................:  |    (the size of the
              * the tab   .       part of the gap       .  |  tabpanel top border)
              *           .      outside of the tab     .  v
              * ----------------------------------------------
              *
-             * To draw the gap, we use gtk_render_frame_gap(), see comment in
-             * moz_gtk_tabpanels_paint(). This gap is made 3 * gap_height tall,
+             * To draw the gap, we use gtk_paint_box_gap(), see comment in
+             * moz_gtk_tabpanels_paint(). This box_gap is made 3 * gap_height tall,
              * which should suffice to ensure that the only visible border is the
              * pierced one.  If the tab is in the middle, we make the box_gap begin
              * a bit to the left of the tab and end a bit to the right, adjusting
              * the gap position so it still is under the tab, because we want the
              * rendering of a gap in the middle of a tabpanel.  This is the role of
              * the gints gap_{l,r}_offset. On the contrary, if the tab is the
              * first, we align the start border of the box_gap with the start
              * border of the tab (left if LTR, right if RTL), by setting the
@@ -1540,66 +1540,67 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
             gap_loffset = gap_roffset = 20; /* should be enough */
             if (flags & MOZ_GTK_TAB_FIRST) {
                 if (direction == GTK_TEXT_DIR_RTL)
                     gap_roffset = initial_gap;
                 else
                     gap_loffset = initial_gap;
             }
 
-            GtkStyleContext* panelStyle =
-                ClaimStyleContext(MOZ_GTK_TABPANELS, direction);
-
             if (isBottomTab) {
                 /* Draw the tab on bottom */
                 focusRect.y += gap_voffset;
                 focusRect.height -= gap_voffset;
 
                 gtk_render_extension(style, cr,
                                      tabRect.x, tabRect.y + gap_voffset, tabRect.width,
                                      tabRect.height - gap_voffset, GTK_POS_TOP);
 
+                gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
+
                 backRect.y += (gap_voffset - gap_height);
                 backRect.height = gap_height;
 
                 /* Draw the gap; erase with background color before painting in
                  * case theme does not */
-                gtk_render_background(panelStyle, cr, backRect.x, backRect.y,
+                gtk_render_background(style, cr, backRect.x, backRect.y,
                                      backRect.width, backRect.height);
                 cairo_save(cr);
                 cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
                 cairo_clip(cr);
 
-                gtk_render_frame_gap(panelStyle, cr,
+                gtk_render_frame_gap(style, cr,
                                      tabRect.x - gap_loffset,
                                      tabRect.y + gap_voffset - 3 * gap_height,
                                      tabRect.width + gap_loffset + gap_roffset,
                                      3 * gap_height, GTK_POS_BOTTOM,
                                      gap_loffset, gap_loffset + tabRect.width);
                 cairo_restore(cr);
             } else {
                 /* Draw the tab on top */
                 focusRect.height -= gap_voffset;
                 gtk_render_extension(style, cr,
                                      tabRect.x, tabRect.y, tabRect.width,
                                      tabRect.height - gap_voffset, GTK_POS_BOTTOM);
 
+                gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
+
                 backRect.y += (tabRect.height - gap_voffset);
                 backRect.height = gap_height;
 
                 /* Draw the gap; erase with background color before painting in
                  * case theme does not */
-                gtk_render_background(panelStyle, cr, backRect.x, backRect.y,
+                gtk_render_background(style, cr, backRect.x, backRect.y,
                                       backRect.width, backRect.height);
 
                 cairo_save(cr);
                 cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
                 cairo_clip(cr);
 
-                gtk_render_frame_gap(panelStyle, cr,
+                gtk_render_frame_gap(style, cr,
                                      tabRect.x - gap_loffset,
                                      tabRect.y + tabRect.height - gap_voffset,
                                      tabRect.width + gap_loffset + gap_roffset,
                                      3 * gap_height, GTK_POS_TOP,
                                      gap_loffset, gap_loffset + tabRect.width);
                 cairo_restore(cr);
             }
         }