12016-04-26 Carlos Garcia Campos <cgarcia@igalia.com>
2
3 [GTK] Overlay scrollbars with steppers enabled render incorrectly
4 https://bugs.webkit.org/show_bug.cgi?id=156988
5
6 Reviewed by NOBODY (OOPS!).
7
8 Fix rendering of scrollbars when using GTK+ themes having stepper buttons.
9
10 * platform/gtk/RenderThemeGadget.cpp:
11 (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter.
12 (WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation.
13 (WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers.
14 * platform/gtk/RenderThemeGadget.h:
15 (WebCore::RenderThemeGadget::context): Make this public instead of protected.
16 * platform/gtk/ScrollAnimatorGtk.cpp:
17 (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just
18 the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in
19 indicator mode too.
20 * platform/gtk/ScrollbarThemeGtk.cpp:
21 (WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally.
22 (WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor.
23 (WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account.
24 (WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle.
25 (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
26 (WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper
27 buttons, and fix the calculation of the steppers button rectangle.
28 (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons.
29 (WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness.
30 (WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor.
31 * platform/gtk/ScrollbarThemeGtk.h:
32 * rendering/RenderThemeGtk.cpp:
33 (WebCore::menuListColor): Ditto.
34 (WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto.
35 (WebCore::RenderThemeGtk::paintMenuList): Ditto.
36