Changeset 69119 in webkit


Ignore:
Timestamp:
Oct 5, 2010 10:03:12 AM (14 years ago)
Author:
Martin Robinson
Message:

2010-10-05 Martin Robinson <mrobinson@igalia.com>

Reviewed by Xan Lopez.

[GTK] Interior scrollbars do not draw their background properly
https://bugs.webkit.org/show_bug.cgi?id=47096

Correct the method that the GTK+ theme drawing code uses to
draw scrolled window backgrounds. Now it uses gtk_paint_shadow,
the same as the actual code from GTK+.

No new tests as this is very hard to write tests for. The bug only
manifests on some GTK+ themes and we have no test harness mechanism
for testing rendering with non-default GTK+ themes.

  • platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): No longer initialize the widget state, as it's unused by the callee. (WebCore::ScrollbarThemeGtk::paint): Remove an inaccurate comment.
  • platform/gtk/gtk2drawing.c: (moz_gtk_scrolled_window_paint): Paint scrolled window backgrounds with gtk_paint_shadow instead of gtk_paint_box.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r69118 r69119  
     12010-10-05  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Interior scrollbars do not draw their background properly
     6        https://bugs.webkit.org/show_bug.cgi?id=47096
     7
     8        Correct the method that the GTK+ theme drawing code uses to
     9        draw scrolled window backgrounds. Now it uses gtk_paint_shadow,
     10        the same as the actual code from GTK+.
     11
     12        No new tests as this is very hard to write tests for. The bug only
     13        manifests on some GTK+ themes and we have no test harness mechanism
     14        for testing rendering with non-default GTK+ themes.
     15
     16        * platform/gtk/ScrollbarThemeGtk.cpp:
     17        (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): No longer
     18        initialize the widget state, as it's unused by the callee.
     19        (WebCore::ScrollbarThemeGtk::paint): Remove an inaccurate comment.
     20        * platform/gtk/gtk2drawing.c:
     21        (moz_gtk_scrolled_window_paint): Paint scrolled window backgrounds
     22        with gtk_paint_shadow instead of gtk_paint_box.
     23
    1242010-10-05  Kwang Yul Seo  <skyul@company100.net>
    225
  • trunk/WebCore/platform/gtk/ScrollbarThemeGtk.cpp

    r66845 r69119  
    222222void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
    223223{
     224    // This is unused by the moz_gtk_scrollecd_window_paint.
    224225    GtkWidgetState state;
    225     state.focused = FALSE;
    226     state.isDefault = FALSE;
    227     state.canDefault = FALSE;
    228     state.disabled = FALSE;
    229     state.active = TRUE;
    230     state.inHover = FALSE;
    231 
    232226    IntRect fullScrollbarRect = IntRect(scrollbar->x(), scrollbar->y(), scrollbar->width(), scrollbar->height());
    233227    static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get())->paintMozillaGtkWidget(MOZ_GTK_SCROLLED_WINDOW, context, fullScrollbarRect, &state, 0);
     
    304298    }
    305299
    306     // Paint the scrollbar background (only used by custom CSS scrollbars).
    307300    paintScrollbarBackground(graphicsContext, scrollbar);
    308301
  • trunk/WebCore/platform/gtk/gtk2drawing.c

    r67609 r69119  
    10991099                              GdkRectangle* cliprect, GtkWidgetState* state)
    11001100{
    1101     GtkStateType state_type = ConvertGtkState(state);
    1102     GtkShadowType shadow_type = (state->active) ?  GTK_SHADOW_IN : GTK_SHADOW_OUT;
    11031101    GtkStyle* style;
    11041102    GtkAllocation allocation;
     
    11171115    style = gtk_widget_get_style(widget);
    11181116    TSOffsetStyleGCs(style, rect->x - 1, rect->y - 1);
    1119     gtk_paint_box(style, drawable, state_type, shadow_type, cliprect,
    1120                   widget, "scrolled_window", rect->x - 1, rect->y - 1,
    1121                   rect->width + 2, rect->height + 2);
     1117    gtk_paint_shadow(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
     1118                     cliprect, gParts->scrolledWindowWidget, "scrolled_window",
     1119                     rect->x, rect->y, rect->width, rect->height);
    11221120    return MOZ_GTK_SUCCESS;
    11231121}
Note: See TracChangeset for help on using the changeset viewer.