Changeset 65851 in webkit


Ignore:
Timestamp:
Aug 23, 2010 6:25:37 PM (14 years ago)
Author:
Martin Robinson
Message:

2010-08-23 Martin Robinson <mrobinson@igalia.com>

Reviewed by Gustavo Noronha Silva.

[GTK] The Mozilla theme drawing code incorrectly renders scrollbar backgrounds
https://bugs.webkit.org/show_bug.cgi?id=44388

No new tests as this functionality is currently unused. When the
the new scrollbar theme code lands for GTK+, this will be tested
by scrollbar pixel tests.

  • platform/gtk/gtk2drawing.c: Expose a method to paint scrolled window backgrounds and disable incorrect rendering of scrollbar trough backgrounds. (moz_gtk_scrolled_window_paint): Added. (moz_gtk_scrollbar_trough_paint): Disable incorrect background render.
  • platform/gtk/gtkdrawing.h: Add scrolled window widget type in the enum.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65850 r65851  
     12010-08-23  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] The Mozilla theme drawing code incorrectly renders scrollbar backgrounds
     6        https://bugs.webkit.org/show_bug.cgi?id=44388
     7
     8        No new tests as this functionality is currently unused. When the
     9        the new scrollbar theme code lands for GTK+, this will be tested
     10        by scrollbar pixel tests.
     11
     12        * platform/gtk/gtk2drawing.c: Expose a method to paint scrolled window
     13        backgrounds and disable incorrect rendering of scrollbar trough backgrounds.
     14        (moz_gtk_scrolled_window_paint): Added.
     15        (moz_gtk_scrollbar_trough_paint): Disable incorrect background render.
     16        * platform/gtk/gtkdrawing.h: Add scrolled window widget type in the enum.
     17
    1182010-08-23  Martin Robinson  <mrobinson@igalia.com>
    219
  • trunk/WebCore/platform/gtk/gtk2drawing.c

    r65850 r65851  
    10951095
    10961096static gint
     1097moz_gtk_scrolled_window_paint(GdkDrawable* drawable, GdkRectangle* rect,
     1098                              GdkRectangle* cliprect, GtkWidgetState* state)
     1099{
     1100    GtkStateType state_type = ConvertGtkState(state);
     1101    GtkShadowType shadow_type = (state->active) ?  GTK_SHADOW_IN : GTK_SHADOW_OUT;
     1102    GtkStyle* style;
     1103    GtkAllocation allocation;
     1104    GtkWidget* widget;
     1105
     1106    ensure_scrolled_window_widget();
     1107    widget = gParts->scrolledWindowWidget;
     1108
     1109    gtk_widget_get_allocation(widget, &allocation);
     1110    allocation.x = rect->x;
     1111    allocation.y = rect->y;
     1112    allocation.width = rect->width;
     1113    allocation.height = rect->height;
     1114    gtk_widget_set_allocation(widget, &allocation);
     1115
     1116    style = gtk_widget_get_style(widget);
     1117    TSOffsetStyleGCs(style, rect->x - 1, rect->y - 1);
     1118    gtk_paint_box(style, drawable, state_type, shadow_type, cliprect,
     1119                  widget, "scrolled_window", rect->x - 1, rect->y - 1,
     1120                  rect->width + 2, rect->height + 2);
     1121    return MOZ_GTK_SUCCESS;
     1122}
     1123
     1124static gint
    10971125moz_gtk_scrollbar_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
    10981126                               GdkRectangle* cliprect, GtkWidgetState* state,
     
    12121240
    12131241    TSOffsetStyleGCs(style, rect->x, rect->y);
    1214     gtk_style_apply_default_background(style, drawable, TRUE, GTK_STATE_ACTIVE,
    1215                                        cliprect, rect->x, rect->y,
    1216                                        rect->width, rect->height);
    1217 
    12181242    gtk_paint_box(style, drawable, GTK_STATE_ACTIVE, GTK_SHADOW_IN, cliprect,
    12191243                  GTK_WIDGET(scrollbar), "trough", rect->x, rect->y,
     
    31083132                                             cliprect, state, direction);
    31093133        break;
     3134    case MOZ_GTK_SCROLLED_WINDOW:
     3135        return moz_gtk_scrolled_window_paint(drawable, rect, cliprect, state);
     3136        break;
    31103137    case MOZ_GTK_SCALE_HORIZONTAL:
    31113138    case MOZ_GTK_SCALE_VERTICAL:
  • trunk/WebCore/platform/gtk/gtkdrawing.h

    r65850 r65851  
    182182  MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL,
    183183  MOZ_GTK_SCROLLBAR_THUMB_VERTICAL,
     184  /* Paints the background of a scrolled window */
     185  MOZ_GTK_SCROLLED_WINDOW,
    184186  /* Paints a GtkScale. */
    185187  MOZ_GTK_SCALE_HORIZONTAL,
Note: See TracChangeset for help on using the changeset viewer.