2011-01-11 Martin Robinson <mrobinson@igalia.com>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 23:45:51 +0000 (23:45 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 23:45:51 +0000 (23:45 +0000)
commit3492d4f053352b158dfbe503ff851db86ce67c3e
treeffec73afafc9cb96ecb1b5d779dfc9bd8a1ce82a
parent37abcedaba0d2bd73c9d6156266126b76e5ac400
2011-01-11  Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Gustavo Noronha Silva.

        [GTK] Move toggle button rendering out of gtk2drawing.c
        https://bugs.webkit.org/show_bug.cgi?id=52258

        Updated results. The metrics of checkboxes and radio buttons have changed,
        because the focus rect is no longer considered to be part of the button.

        * platform/gtk/fast/css/non-standard-checkbox-size-expected.txt
        * platform/gtk/fast/forms/001-expected.txt:
        * platform/gtk/fast/forms/basic-inputs-expected.txt:
        * platform/gtk/fast/forms/box-shadow-override-expected.txt:
        * platform/gtk/fast/forms/checkbox-radio-onchange-expected.txt:
        * platform/gtk/fast/forms/file-input-disabled-expected.txt:
        * platform/gtk/fast/forms/form-element-geometry-expected.txt:
        * platform/gtk/fast/forms/formmove-expected.txt:
        * platform/gtk/fast/forms/formmove2-expected.txt:
        * platform/gtk/fast/forms/indeterminate-expected.txt:
        * platform/gtk/fast/forms/input-appearance-height-expected.txt:
        * platform/gtk/fast/forms/input-value-expected.txt:
        * platform/gtk/fast/forms/radio-attr-order-expected.txt:
        * platform/gtk/fast/forms/radio-nested-labels-expected.txt:
        * platform/gtk/fast/forms/radio_checked-expected.txt:
        * platform/gtk/fast/forms/radio_checked_dynamic-expected.txt:
2011-01-11  Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Gustavo Noronha Silva.

        [GTK] Move toggle button rendering out of gtk2drawing.c
        https://bugs.webkit.org/show_bug.cgi?id=52258

        * platform/gtk/RenderThemeGtk.h:
        * platform/gtk/RenderThemeGtk2.cpp:
        (WebCore::RenderThemeGtk::platformInit): Initialize new button members.
        (WebCore::adjustRectForFocus): Added this function which inflates a rect based
        on a widget's exterior focus.
        (WebCore::RenderThemeGtk::adjustRepaintRect): Account for exterior focus.
        (WebCore::setToggleSize): Only listen to indicator-size to properly size
        checkboxes and radio buttons.
        (WebCore::RenderThemeGtk::setCheckboxSize): Call new setToggleSize properly.
        (WebCore::paintToggle): Added.
        (WebCore::RenderThemeGtk::paintCheckbox): Call paintToggle.
        (WebCore::RenderThemeGtk::setRadioSize): Call new setToggleSize properly.
        (WebCore::RenderThemeGtk::paintRadio): Call paintToggle.
        (WebCore::RenderThemeGtk::gtkRadioButton): Added.
        (WebCore::RenderThemeGtk::gtkCheckButton): Added.
        * platform/gtk/WidgetRenderingContext.cpp:
        (WebCore::WidgetRenderingContext::WidgetRenderingContext): Use a static extra space
        variable. This is good enough for all themes that I've tested and prevents having to
        pass information from RenderThemeGtk about every single type of widget.
        (WebCore::WidgetRenderingContext::gtkPaintFocus): Use the paintRect
        to draw instead of m_paintRect. This is important when we're painting
        something that isn't the size of the total rect.
        (WebCore::WidgetRenderingContext::gtkPaintCheck): Added.
        (WebCore::WidgetRenderingContext::gtkPaintOption): Added.
        * platform/gtk/WidgetRenderingContext.h: Updated to reflect new methods.
        * platform/gtk/gtkdrawing.h: Remove newly unused code.
        * platform/gtk/gtk2drawing.c: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/gtk/fast/css/non-standard-checkbox-size-expected.txt
LayoutTests/platform/gtk/fast/forms/001-expected.txt
LayoutTests/platform/gtk/fast/forms/basic-inputs-expected.txt
LayoutTests/platform/gtk/fast/forms/box-shadow-override-expected.txt
LayoutTests/platform/gtk/fast/forms/checkbox-radio-onchange-expected.txt
LayoutTests/platform/gtk/fast/forms/file-input-disabled-expected.txt
LayoutTests/platform/gtk/fast/forms/form-element-geometry-expected.txt
LayoutTests/platform/gtk/fast/forms/formmove-expected.txt
LayoutTests/platform/gtk/fast/forms/formmove2-expected.txt
LayoutTests/platform/gtk/fast/forms/indeterminate-expected.txt
LayoutTests/platform/gtk/fast/forms/input-appearance-height-expected.txt
LayoutTests/platform/gtk/fast/forms/input-value-expected.txt
LayoutTests/platform/gtk/fast/forms/radio-attr-order-expected.txt
LayoutTests/platform/gtk/fast/forms/radio-nested-labels-expected.txt
LayoutTests/platform/gtk/fast/forms/radio_checked-expected.txt
LayoutTests/platform/gtk/fast/forms/radio_checked_dynamic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/RenderThemeGtk.h
Source/WebCore/platform/gtk/RenderThemeGtk2.cpp
Source/WebCore/platform/gtk/WidgetRenderingContext.cpp
Source/WebCore/platform/gtk/WidgetRenderingContext.h
Source/WebCore/platform/gtk/gtk2drawing.c
Source/WebCore/platform/gtk/gtkdrawing.h