Changeset 69436 in webkit


Ignore:
Timestamp:
Oct 8, 2010 6:58:05 PM (14 years ago)
Author:
Martin Robinson
Message:

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

Reviewed by Daniel Bates.

[GTK] Fails /LayoutTests/fast/css/button-height.html
https://bugs.webkit.org/show_bug.cgi?id=33936

Unskip a test that is now passing and update baselines for
other tests.

  • platform/gtk/Skipped: Update skipped list.
  • platform/gtk/fast/forms/box-shadow-override-expected.txt:
  • platform/gtk/fast/forms/button-style-color-expected.txt:
  • platform/gtk/fast/forms/input-button-sizes-expected.txt:

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

Reviewed by Daniel Bates.

[GTK] Fails /LayoutTests/fast/css/button-height.html
https://bugs.webkit.org/show_bug.cgi?id=33936

GTK buttons honor height property set via CSS. The code for the method
adjustButtonStyle originates from the original GTK+ theme drawing code
and is clearly just a copy-paste from the Safari theme drawing code. The
Safari theme drawing code does quite a bit of work to ensure that button
fonts are consistent with the system theme, which is not something the GTK+
port does.

This change brings the method more in line with the Chromium port, which
allows CSS to style buttons, only overriding the line-height property,
which is required for layout tests to pass.

  • platform/gtk/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::adjustButtonStyle): No longer override most CSS properties for button styling.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69433 r69436  
     12010-10-08  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Daniel Bates.
     4
     5        [GTK] Fails /LayoutTests/fast/css/button-height.html
     6        https://bugs.webkit.org/show_bug.cgi?id=33936
     7
     8        Unskip a test that is now passing and update baselines for
     9        other tests.
     10
     11        * platform/gtk/Skipped: Update skipped list.
     12        * platform/gtk/fast/forms/box-shadow-override-expected.txt:
     13        * platform/gtk/fast/forms/button-style-color-expected.txt:
     14        * platform/gtk/fast/forms/input-button-sizes-expected.txt:
     15
    1162010-10-08  Albert J. Wong  <ajwong@chromium.org>
    217
  • trunk/LayoutTests/platform/gtk/Skipped

    r69420 r69436  
    50155015# Tests with bugs attached : Enable these tests again once these bugs are fixed.
    50165016# ------------------
    5017 
    5018 # Height not honored for <input> and <button> elements.
    5019 # See Bug #33936 - https://bugs.webkit.org/show_bug.cgi?id=33936
    5020 fast/css/button-height.html
    5021 # I think this is related. Essentially we aren't honoring style
    5022 # information for widgets.
    5023 fast/forms/textarea-metrics.html
    5024 
    50255017# See Bug #27905 - http://bugs.webkit.org/show_bug.cgi?id=27905
    50265018# Missing resource load callback ability in DRT
     
    56705662fast/forms/basic-selects.html
    56715663fast/forms/basic-textareas-quirks.html
     5664fast/forms/textarea-metrics.html
    56725665
    56735666# Fake italics do not work: https://bugs.webkit.org/show_bug.cgi?id=40856
  • trunk/LayoutTests/platform/gtk/fast/forms/box-shadow-override-expected.txt

    r68406 r69436  
    2828            RenderBlock {DIV} at (148,1) size 14x14
    2929        RenderText {#text} at (0,0) size 0x0
    30       RenderBlock (anonymous) at (0,157) size 784x35
     30      RenderBlock (anonymous) at (0,157) size 784x36
    3131        RenderBlock {INPUT} at (4,11) size 15x15
    3232        RenderText {#text} at (23,9) size 4x19
     
    3939        RenderText {#text} at (187,9) size 4x19
    4040          text run at (187,9) width 4: " "
    41         RenderFileUploadControl {INPUT} at (193,5) size 272x27 "(None)"
    42           RenderButton {INPUT} at (0,0) size 89x27 [bgcolor=#C0C0C0]
     41        RenderFileUploadControl {INPUT} at (193,5) size 272x28 "(None)"
     42          RenderButton {INPUT} at (0,0) size 89x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    4343            RenderBlock (anonymous) at (8,4) size 73x19
    4444              RenderText at (0,0) size 73x19
     
    4646        RenderText {#text} at (467,9) size 4x19
    4747          text run at (467,9) width 4: " "
    48         RenderButton {INPUT} at (473,2) size 67x31 [bgcolor=#C0C0C0]
     48        RenderButton {INPUT} at (473,2) size 67x32 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    4949          RenderBlock (anonymous) at (8,4) size 51x23
    5050            RenderText at (0,0) size 51x23
     
    5252        RenderText {#text} at (542,9) size 4x19
    5353          text run at (542,9) width 4: " "
    54         RenderButton {INPUT} at (548,5) size 56x27 [bgcolor=#C0C0C0]
     54        RenderButton {INPUT} at (548,5) size 56x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    5555          RenderBlock (anonymous) at (8,4) size 40x19
    5656            RenderText at (0,0) size 40x19
     
    5858        RenderText {#text} at (606,9) size 4x19
    5959          text run at (606,9) width 4: " "
    60         RenderButton {INPUT} at (610,15) size 30x15 [bgcolor=#C0C0C0]
     60        RenderButton {INPUT} at (610,15) size 30x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    6161          RenderBlock (anonymous) at (8,4) size 14x7
    6262            RenderText at (0,0) size 14x7
     
    6464        RenderText {#text} at (640,9) size 4x19
    6565          text run at (640,9) width 4: " "
    66         RenderButton {BUTTON} at (646,4) size 67x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0) none (2px outset #C0C0C0)]
    67           RenderBlock (anonymous) at (8,2) size 51x23
     66        RenderButton {BUTTON} at (646,2) size 67x32 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
     67          RenderBlock (anonymous) at (8,4) size 51x23
    6868            RenderText {#text} at (0,0) size 51x23
    6969              text run at (0,0) width 51: "Button"
  • trunk/LayoutTests/platform/gtk/fast/forms/button-style-color-expected.txt

    r68406 r69436  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderButton {BUTTON} at (2,4) size 86x24 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0) none (2px outset #C0C0C0)]
    7         RenderBlock (anonymous) at (8,2) size 70x19
     6      RenderButton {BUTTON} at (2,2) size 86x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
     7        RenderBlock (anonymous) at (8,4) size 70x19
    88          RenderText {#text} at (0,0) size 70x19
    99            text run at (0,0) width 70: "Test Button"
    1010      RenderText {#text} at (90,6) size 4x19
    1111        text run at (90,6) width 4: " "
    12       RenderButton {BUTTON} at (96,4) size 86x24 [color=#FF0000] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0) none (2px outset #C0C0C0)]
    13         RenderBlock (anonymous) at (8,2) size 70x19
     12      RenderButton {BUTTON} at (96,2) size 86x28 [color=#FF0000] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
     13        RenderBlock (anonymous) at (8,4) size 70x19
    1414          RenderText {#text} at (0,0) size 70x19
    1515            text run at (0,0) width 70: "Test Button"
     
    2828      RenderText {#text} at (372,6) size 4x19
    2929        text run at (372,6) width 4: " "
    30       RenderButton {INPUT} at (378,2) size 86x27 [bgcolor=#C0C0C0]
     30      RenderButton {INPUT} at (378,2) size 86x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    3131        RenderBlock (anonymous) at (8,4) size 70x19
    3232          RenderText at (0,0) size 70x19
     
    3434      RenderText {#text} at (466,6) size 4x19
    3535        text run at (466,6) width 4: " "
    36       RenderButton {INPUT} at (472,2) size 86x27 [color=#FF0000] [bgcolor=#C0C0C0]
     36      RenderButton {INPUT} at (472,2) size 86x28 [color=#FF0000] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    3737        RenderBlock (anonymous) at (8,4) size 70x19
    3838          RenderText at (0,0) size 70x19
  • trunk/LayoutTests/platform/gtk/fast/forms/input-button-sizes-expected.txt

    r69366 r69436  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderButton {INPUT} at (0,11) size 39x15 [bgcolor=#C0C0C0]
     6      RenderButton {INPUT} at (0,11) size 39x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    77        RenderBlock (anonymous) at (8,4) size 23x7
    88          RenderText at (0,0) size 23x7
     
    1010      RenderText {#text} at (39,5) size 4x19
    1111        text run at (39,5) width 4: " "
    12       RenderButton {INPUT} at (43,10) size 46x16 [bgcolor=#C0C0C0]
     12      RenderButton {INPUT} at (43,10) size 46x17 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    1313        RenderBlock (anonymous) at (8,4) size 30x8
    1414          RenderText at (0,0) size 30x8
     
    1616      RenderText {#text} at (89,5) size 4x19
    1717        text run at (89,5) width 4: " "
    18       RenderButton {INPUT} at (93,9) size 51x17 [bgcolor=#C0C0C0]
     18      RenderButton {INPUT} at (93,9) size 51x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    1919        RenderBlock (anonymous) at (8,4) size 35x9
    2020          RenderText at (0,0) size 35x9
     
    2222      RenderText {#text} at (144,5) size 4x19
    2323        text run at (144,5) width 4: " "
    24       RenderButton {INPUT} at (148,8) size 53x18 [bgcolor=#C0C0C0]
     24      RenderButton {INPUT} at (148,8) size 53x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    2525        RenderBlock (anonymous) at (8,4) size 37x10
    2626          RenderText at (0,0) size 37x10
     
    2828      RenderText {#text} at (201,5) size 4x19
    2929        text run at (201,5) width 4: " "
    30       RenderButton {INPUT} at (205,7) size 61x19 [bgcolor=#C0C0C0]
     30      RenderButton {INPUT} at (205,7) size 61x20 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    3131        RenderBlock (anonymous) at (8,4) size 45x11
    3232          RenderText at (0,0) size 45x11
     
    3434      RenderText {#text} at (266,5) size 4x19
    3535        text run at (266,5) width 4: " "
    36       RenderButton {INPUT} at (270,7) size 65x20 [bgcolor=#C0C0C0]
     36      RenderButton {INPUT} at (270,7) size 65x21 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    3737        RenderBlock (anonymous) at (8,4) size 49x12
    3838          RenderText at (0,0) size 49x12
     
    4040      RenderText {#text} at (335,5) size 4x19
    4141        text run at (335,5) width 4: " "
    42       RenderButton {INPUT} at (341,6) size 72x21 [bgcolor=#C0C0C0]
     42      RenderButton {INPUT} at (341,6) size 72x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    4343        RenderBlock (anonymous) at (8,4) size 56x13
    4444          RenderText at (0,0) size 56x13
     
    4646      RenderText {#text} at (415,5) size 4x19
    4747        text run at (415,5) width 4: " "
    48       RenderButton {INPUT} at (421,5) size 75x22 [bgcolor=#C0C0C0]
     48      RenderButton {INPUT} at (421,5) size 75x23 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    4949        RenderBlock (anonymous) at (8,4) size 59x14
    5050          RenderText at (0,0) size 59x14
     
    5252      RenderText {#text} at (498,5) size 4x19
    5353        text run at (498,5) width 4: " "
    54       RenderButton {INPUT} at (504,4) size 80x23 [bgcolor=#C0C0C0]
     54      RenderButton {INPUT} at (504,4) size 80x24 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    5555        RenderBlock (anonymous) at (8,4) size 64x15
    5656          RenderText at (0,0) size 64x15
     
    5858      RenderText {#text} at (586,5) size 4x19
    5959        text run at (586,5) width 4: " "
    60       RenderButton {INPUT} at (592,3) size 82x25 [bgcolor=#C0C0C0]
     60      RenderButton {INPUT} at (592,3) size 82x26 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    6161        RenderBlock (anonymous) at (8,4) size 66x17
    6262          RenderText at (0,0) size 66x17
     
    6464      RenderText {#text} at (676,5) size 4x19
    6565        text run at (676,5) width 4: " "
    66       RenderButton {INPUT} at (682,2) size 85x26 [bgcolor=#C0C0C0]
     66      RenderButton {INPUT} at (682,2) size 85x27 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    6767        RenderBlock (anonymous) at (8,4) size 69x18
    6868          RenderText at (0,0) size 69x18
     
    7070      RenderText {#text} at (769,5) size 4x19
    7171        text run at (769,5) width 4: " "
    72       RenderButton {INPUT} at (2,36) size 86x27 [bgcolor=#C0C0C0]
     72      RenderButton {INPUT} at (2,37) size 86x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    7373        RenderBlock (anonymous) at (8,4) size 70x19
    7474          RenderText at (0,0) size 70x19
    7575            text run at (0,0) width 70: "Test Button"
    76       RenderText {#text} at (90,40) size 4x19
    77         text run at (90,40) width 4: " "
    78       RenderButton {INPUT} at (96,35) size 95x28 [bgcolor=#C0C0C0]
     76      RenderText {#text} at (90,41) size 4x19
     77        text run at (90,41) width 4: " "
     78      RenderButton {INPUT} at (96,36) size 95x29 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    7979        RenderBlock (anonymous) at (8,4) size 79x20
    8080          RenderText at (0,0) size 79x20
    8181            text run at (0,0) width 79: "Test Button"
    82       RenderText {#text} at (193,40) size 4x19
    83         text run at (193,40) width 4: " "
    84       RenderButton {INPUT} at (199,34) size 102x29 [bgcolor=#C0C0C0]
     82      RenderText {#text} at (193,41) size 4x19
     83        text run at (193,41) width 4: " "
     84      RenderButton {INPUT} at (199,35) size 102x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    8585        RenderBlock (anonymous) at (8,4) size 86x21
    8686          RenderText at (0,0) size 86x21
    8787            text run at (0,0) width 86: "Test Button"
    88       RenderText {#text} at (303,40) size 4x19
    89         text run at (303,40) width 4: " "
    90       RenderButton {INPUT} at (309,34) size 104x30 [bgcolor=#C0C0C0]
     88      RenderText {#text} at (303,41) size 4x19
     89        text run at (303,41) width 4: " "
     90      RenderButton {INPUT} at (309,35) size 104x31 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    9191        RenderBlock (anonymous) at (8,4) size 88x22
    9292          RenderText at (0,0) size 88x22
    9393            text run at (0,0) width 88: "Test Button"
    94       RenderText {#text} at (415,40) size 4x19
    95         text run at (415,40) width 4: " "
    96       RenderButton {INPUT} at (421,33) size 106x31 [bgcolor=#C0C0C0]
     94      RenderText {#text} at (415,41) size 4x19
     95        text run at (415,41) width 4: " "
     96      RenderButton {INPUT} at (421,34) size 106x32 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    9797        RenderBlock (anonymous) at (8,4) size 90x23
    9898          RenderText at (0,0) size 90x23
    9999            text run at (0,0) width 90: "Test Button"
    100       RenderText {#text} at (529,40) size 4x19
    101         text run at (529,40) width 4: " "
    102       RenderButton {INPUT} at (535,32) size 114x32 [bgcolor=#C0C0C0]
     100      RenderText {#text} at (529,41) size 4x19
     101        text run at (529,41) width 4: " "
     102      RenderButton {INPUT} at (535,33) size 114x33 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
    103103        RenderBlock (anonymous) at (8,4) size 98x24
    104104          RenderText at (0,0) size 98x24
  • trunk/WebCore/ChangeLog

    r69432 r69436  
     12010-10-08  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Daniel Bates.
     4
     5        [GTK] Fails /LayoutTests/fast/css/button-height.html
     6        https://bugs.webkit.org/show_bug.cgi?id=33936
     7
     8        GTK buttons honor height property set via CSS. The code for the method
     9        adjustButtonStyle originates from the original GTK+ theme drawing code
     10        and is clearly just a copy-paste from the Safari theme drawing code. The
     11        Safari theme drawing code does quite a bit of work to ensure that button
     12        fonts are consistent with the system theme, which is not something the GTK+
     13        port does.
     14
     15        This change brings the method more in line with the Chromium port, which
     16        allows CSS to style buttons, only overriding the line-height property,
     17        which is required for layout tests to pass.
     18
     19        * platform/gtk/RenderThemeGtk.cpp:
     20        (WebCore::RenderThemeGtk::adjustButtonStyle): No longer override most CSS
     21        properties for button styling.
     22
    1232010-10-08  Mihai Parparita  <mihaip@chromium.org>
    224
  • trunk/WebCore/platform/gtk/RenderThemeGtk.cpp

    r69381 r69436  
    381381}
    382382
    383 static void setButtonPadding(RenderStyle* style)
    384 {
    385     // FIXME: This looks incorrect.
    386     const int padding = 8;
    387     style->setPaddingLeft(Length(padding, Fixed));
    388     style->setPaddingRight(Length(padding, Fixed));
    389     style->setPaddingTop(Length(padding / 2, Fixed));
    390     style->setPaddingBottom(Length(padding / 2, Fixed));
    391 }
    392 
    393383static void setToggleSize(const RenderThemeGtk* theme, RenderStyle* style, ControlPart appearance)
    394384{
     
    445435void RenderThemeGtk::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, WebCore::Element* e) const
    446436{
    447     // FIXME: Is this condition necessary?
    448     if (style->appearance() == PushButtonPart) {
    449         style->resetBorder();
    450         style->setHeight(Length(Auto));
    451         style->setWhiteSpace(PRE);
    452         setButtonPadding(style);
    453     } else {
    454         // FIXME: This should not be hard-coded.
    455         style->setMinHeight(Length(14, Fixed));
    456         style->resetBorderTop();
    457         style->resetBorderBottom();
    458     }
     437    // Some layout tests check explicitly that buttons ignore line-height.
     438    if (style->appearance() == PushButtonPart)
     439        style->setLineHeight(RenderStyle::initialLineHeight());
    459440}
    460441
Note: See TracChangeset for help on using the changeset viewer.