Changeset 87881 in webkit


Ignore:
Timestamp:
Jun 2, 2011 12:04:05 AM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-06-01 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Remove outer-spin-button
https://bugs.webkit.org/show_bug.cgi?id=61845

Update Mac expectations because the position of steppers are moved.

  • platform/chromium/test_expectations.txt:
  • platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png:
  • platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt:
  • platform/mac/fast/forms/input-appearance-spinbutton-expected.png:
  • platform/mac/fast/forms/input-appearance-spinbutton-expected.txt:
  • platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png:
  • platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt:
  • platform/mac/fast/forms/input-appearance-spinbutton-up-expected.png:
  • platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt:
  • platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.png:
  • platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.txt:

2011-06-01 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Remove outer-spin-button
https://bugs.webkit.org/show_bug.cgi?id=61845

Remove outer-spin-button, and render steppers as inner-spin-button.
Outer-spin-button have never worked well with padding and border of
<input>, and the layout code is very tricky and very hard to maintain it.

  • css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
  • css/CSSValueKeywords.in:
  • css/html.css:
  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::innerSpinButtonElement):
  • html/HTMLInputElement.h:
  • html/InputType.h:
  • html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::TextFieldInputType): (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::destroyShadowSubtree):
  • html/TextFieldInputType.h:
  • html/shadow/TextControlInnerElements.cpp: (WebCore::SpinButtonElement::SpinButtonElement): (WebCore::SpinButtonElement::create): (WebCore::SpinButtonElement::shadowPseudoId):
  • html/shadow/TextControlInnerElements.h:
  • platform/ThemeTypes.h:
  • platform/chromium/ThemeChromiumMac.mm: (WebCore::paintStepper): Center the stepper drawing area because the specified area can be larger than the NSStepper sizes. (WebCore::ThemeChromiumMac::controlSize): (WebCore::ThemeChromiumMac::minimumControlSize): (WebCore::ThemeChromiumMac::inflateControlPaintRect): (WebCore::ThemeChromiumMac::paint):
  • platform/mac/ThemeMac.mm: (WebCore::paintStepper): Center the stepper drawing area because the specified area can be larger than the NSStepper sizes. (WebCore::ThemeMac::controlSize): (WebCore::ThemeMac::minimumControlSize): (WebCore::ThemeMac::inflateControlPaintRect): (WebCore::ThemeMac::paint):
  • rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations):
  • rendering/RenderBox.h:
  • rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): (WebCore::RenderTextControlSingleLine::nodeAtPoint): (WebCore::RenderTextControlSingleLine::textBlockWidth):
  • rendering/RenderTextControlSingleLine.h:
  • rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
  • rendering/RenderTheme.h:
  • rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::adjustRepaintRect):
Location:
trunk
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r87872 r87881  
     12011-06-01  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Remove outer-spin-button
     6        https://bugs.webkit.org/show_bug.cgi?id=61845
     7
     8        Update Mac expectations because the position of steppers are moved.
     9
     10        * platform/chromium/test_expectations.txt:
     11        * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png:
     12        * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt:
     13        * platform/mac/fast/forms/input-appearance-spinbutton-expected.png:
     14        * platform/mac/fast/forms/input-appearance-spinbutton-expected.txt:
     15        * platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png:
     16        * platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt:
     17        * platform/mac/fast/forms/input-appearance-spinbutton-up-expected.png:
     18        * platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt:
     19        * platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.png:
     20        * platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.txt:
     21
    1222011-06-01  Adam Barth  <abarth@webkit.org>
    223
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r87872 r87881  
    38763876BUGCR82891 LINUX : fast/speech/input-appearance-speechbutton.html = IMAGE+TEXT PASS
    38773877BUGWK59208 WIN MAC : fast/speech/input-appearance-searchandspeech.html = FAIL
     3878// Need rebaseline.
     3879BUGWK61845 MAC : fast/speech/input-appearance-numberandspeech.html = FAIL
    38783880
    38793881// Fails on windows - added in r86693
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt

    r83145 r87881  
    2222          RenderText {#text} at (222,10) size 102x18
    2323            text run at (222,10) width 102: " Read-only state"
    24 layer at (13,47) size 188x23
    25   RenderBlock {DIV} at (3,3) size 188x23
     24layer at (13,47) size 193x23
     25  RenderBlock {DIV} at (3,3) size 193x23
    2626    RenderText {#text} at (1,0) size 13x23
    2727      text run at (1,0) width 13: "0"
    28 layer at (13,80) size 188x23
    29   RenderBlock {DIV} at (3,3) size 188x23 [color=#545454]
     28layer at (13,80) size 193x23
     29  RenderBlock {DIV} at (3,3) size 193x23 [color=#545454]
    3030    RenderText {#text} at (1,0) size 13x23
    3131      text run at (1,0) width 13: "0"
    32 layer at (13,113) size 188x23
    33   RenderBlock {DIV} at (3,3) size 188x23
     32layer at (13,113) size 193x23
     33  RenderBlock {DIV} at (3,3) size 193x23
    3434    RenderText {#text} at (1,0) size 13x23
    3535      text run at (1,0) width 13: "0"
    36 layer at (206,45) size 19x27
    37   RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
    38 layer at (206,78) size 19x27
    39   RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
    40 layer at (206,111) size 19x27
    41   RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
     36layer at (207,46) size 19x25
     37  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
     38layer at (207,79) size 19x25
     39  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
     40layer at (207,112) size 19x25
     41  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.txt

    r83145 r87881  
    112112layer at (14,129) size 94x10
    113113  RenderBlock {DIV} at (3,3) size 94x10
    114 layer at (14,145) size 76x10
    115   RenderBlock {DIV} at (3,3) size 76x10
     114layer at (14,145) size 81x10
     115  RenderBlock {DIV} at (3,3) size 81x10
    116116layer at (14,163) size 96x11
    117117  RenderBlock {DIV} at (3,3) size 96x11
    118 layer at (14,180) size 78x11
    119   RenderBlock {DIV} at (3,3) size 78x11
     118layer at (14,180) size 83x11
     119  RenderBlock {DIV} at (3,3) size 83x11
    120120layer at (14,198) size 98x12
    121121  RenderBlock {DIV} at (3,3) size 98x12
    122 layer at (14,216) size 80x12
    123   RenderBlock {DIV} at (3,3) size 80x12
     122layer at (14,216) size 85x12
     123  RenderBlock {DIV} at (3,3) size 85x12
    124124layer at (16,236) size 119x13
    125125  RenderBlock {DIV} at (3,3) size 119x13
    126 layer at (16,259) size 101x13
    127   RenderBlock {DIV} at (3,3) size 101x13
     126layer at (16,259) size 106x13
     127  RenderBlock {DIV} at (3,3) size 106x13
    128128layer at (16,282) size 121x15
    129129  RenderBlock {DIV} at (3,3) size 121x15
    130 layer at (16,307) size 103x15
    131   RenderBlock {DIV} at (3,3) size 103x15
     130layer at (16,307) size 108x15
     131  RenderBlock {DIV} at (3,3) size 108x15
    132132layer at (16,332) size 142x16
    133133  RenderBlock {DIV} at (3,3) size 142x16
    134 layer at (16,358) size 122x16
    135   RenderBlock {DIV} at (3,3) size 122x16
     134layer at (16,358) size 127x16
     135  RenderBlock {DIV} at (3,3) size 127x16
    136136layer at (16,384) size 144x17
    137137  RenderBlock {DIV} at (3,3) size 144x17
    138 layer at (16,411) size 124x17
    139   RenderBlock {DIV} at (3,3) size 124x17
     138layer at (16,411) size 129x17
     139  RenderBlock {DIV} at (3,3) size 129x17
    140140layer at (16,438) size 164x18
    141141  RenderBlock {DIV} at (3,3) size 164x18
    142 layer at (16,466) size 144x18
    143   RenderBlock {DIV} at (3,3) size 144x18
     142layer at (16,466) size 149x18
     143  RenderBlock {DIV} at (3,3) size 149x18
    144144layer at (198,50) size 166x18
    145145  RenderBlock {DIV} at (3,3) size 166x18
    146 layer at (198,78) size 146x18
    147   RenderBlock {DIV} at (3,3) size 146x18
     146layer at (198,78) size 151x18
     147  RenderBlock {DIV} at (3,3) size 151x18
    148148layer at (198,106) size 168x20
    149149  RenderBlock {DIV} at (3,3) size 168x20
    150 layer at (198,136) size 148x20
    151   RenderBlock {DIV} at (3,3) size 148x20
     150layer at (198,136) size 153x20
     151  RenderBlock {DIV} at (3,3) size 153x20
    152152layer at (198,166) size 189x21
    153153  RenderBlock {DIV} at (3,3) size 189x21
    154 layer at (198,197) size 165x21
    155   RenderBlock {DIV} at (3,3) size 165x21
     154layer at (198,197) size 170x21
     155  RenderBlock {DIV} at (3,3) size 170x21
    156156layer at (198,228) size 191x22
    157157  RenderBlock {DIV} at (3,3) size 191x22
    158 layer at (198,260) size 167x22
    159   RenderBlock {DIV} at (3,3) size 167x22
     158layer at (198,260) size 172x22
     159  RenderBlock {DIV} at (3,3) size 172x22
    160160layer at (198,292) size 212x23
    161161  RenderBlock {DIV} at (3,3) size 212x23
    162 layer at (198,325) size 188x23
    163   RenderBlock {DIV} at (3,3) size 188x23
     162layer at (198,325) size 193x23
     163  RenderBlock {DIV} at (3,3) size 193x23
    164164layer at (198,358) size 214x24
    165165  RenderBlock {DIV} at (3,3) size 214x24
    166 layer at (198,392) size 190x24
    167   RenderBlock {DIV} at (3,3) size 190x24
     166layer at (198,392) size 195x24
     167  RenderBlock {DIV} at (3,3) size 195x24
    168168layer at (198,426) size 235x26
    169169  RenderBlock {DIV} at (3,3) size 235x26
    170 layer at (198,462) size 211x26
    171   RenderBlock {DIV} at (3,3) size 211x26
     170layer at (198,462) size 216x26
     171  RenderBlock {DIV} at (3,3) size 216x26
    172172layer at (198,498) size 237x27
    173173  RenderBlock {DIV} at (3,3) size 237x27
    174 layer at (198,535) size 213x27
    175   RenderBlock {DIV} at (3,3) size 213x27
    176 layer at (95,143) size 13x15
    177   RenderBlock (relative positioned) {DIV} at (84,1) size 13x15
    178 layer at (97,178) size 13x15
    179   RenderBlock (relative positioned) {DIV} at (86,1) size 13x15
    180 layer at (99,215) size 13x15
    181   RenderBlock (relative positioned) {DIV} at (88,2) size 13x15
    182 layer at (122,258) size 13x15
    183   RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
    184 layer at (124,307) size 13x15
    185   RenderBlock (relative positioned) {DIV} at (111,3) size 13x15
    186 layer at (143,355) size 15x22
    187   RenderBlock (relative positioned) {DIV} at (130,0) size 15x22
    188 layer at (145,409) size 15x22
    189   RenderBlock (relative positioned) {DIV} at (132,1) size 15x22
    190 layer at (165,464) size 15x22
    191   RenderBlock (relative positioned) {DIV} at (152,1) size 15x22
    192 layer at (349,76) size 15x22
    193   RenderBlock (relative positioned) {DIV} at (154,1) size 15x22
    194 layer at (351,135) size 15x22
    195   RenderBlock (relative positioned) {DIV} at (156,2) size 15x22
    196 layer at (368,194) size 19x27
    197   RenderBlock (relative positioned) {DIV} at (173,0) size 19x27
    198 layer at (370,258) size 19x27
    199   RenderBlock (relative positioned) {DIV} at (175,1) size 19x27
    200 layer at (391,323) size 19x27
    201   RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
    202 layer at (393,391) size 19x27
    203   RenderBlock (relative positioned) {DIV} at (198,2) size 19x27
    204 layer at (414,462) size 19x27
    205   RenderBlock (relative positioned) {DIV} at (219,3) size 19x27
    206 layer at (416,535) size 19x27
    207   RenderBlock (relative positioned) {DIV} at (221,3) size 19x27
     174layer at (198,535) size 218x27
     175  RenderBlock {DIV} at (3,3) size 218x27
     176layer at (96,144) size 13x12
     177  RenderBlock (relative positioned) {DIV} at (85,2) size 13x12
     178layer at (98,179) size 13x13
     179  RenderBlock (relative positioned) {DIV} at (87,2) size 13x13
     180layer at (100,215) size 13x14
     181  RenderBlock (relative positioned) {DIV} at (89,2) size 13x14
     182layer at (123,258) size 13x15
     183  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
     184layer at (125,306) size 13x17
     185  RenderBlock (relative positioned) {DIV} at (112,2) size 13x17
     186layer at (144,357) size 15x18
     187  RenderBlock (relative positioned) {DIV} at (131,2) size 15x18
     188layer at (146,410) size 15x19
     189  RenderBlock (relative positioned) {DIV} at (133,2) size 15x19
     190layer at (166,465) size 15x20
     191  RenderBlock (relative positioned) {DIV} at (153,2) size 15x20
     192layer at (350,77) size 15x20
     193  RenderBlock (relative positioned) {DIV} at (155,2) size 15x20
     194layer at (352,135) size 15x22
     195  RenderBlock (relative positioned) {DIV} at (157,2) size 15x22
     196layer at (369,196) size 19x23
     197  RenderBlock (relative positioned) {DIV} at (174,2) size 19x23
     198layer at (371,259) size 19x24
     199  RenderBlock (relative positioned) {DIV} at (176,2) size 19x24
     200layer at (392,324) size 19x25
     201  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
     202layer at (394,391) size 19x26
     203  RenderBlock (relative positioned) {DIV} at (199,2) size 19x26
     204layer at (415,461) size 19x28
     205  RenderBlock (relative positioned) {DIV} at (220,2) size 19x28
     206layer at (417,534) size 19x29
     207  RenderBlock (relative positioned) {DIV} at (222,2) size 19x29
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt

    r83145 r87881  
    77      RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    88      RenderText {#text} at (0,0) size 0x0
    9 layer at (13,36) size 101x13
    10   RenderBlock {DIV} at (3,3) size 101x13
     9layer at (13,36) size 106x13
     10  RenderBlock {DIV} at (3,3) size 106x13
    1111    RenderText {#text} at (1,0) size 14x13
    1212      text run at (1,0) width 14: "10"
    1313layer at (10,10) size 125x19
    1414  RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    15 layer at (13,13) size 101x13
    16   RenderBlock {DIV} at (3,3) size 101x13
     15layer at (13,13) size 106x13
     16  RenderBlock {DIV} at (3,3) size 106x13
    1717    RenderText {#text} at (1,0) size 14x13
    1818      text run at (1,0) width 14: "10"
    19 layer at (119,12) size 13x15
    20   RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
    21 layer at (119,35) size 13x15
    22   RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
     19layer at (120,12) size 13x15
     20  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
     21layer at (120,35) size 13x15
     22  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt

    r87067 r87881  
    1212        RenderText {#text} at (0,0) size 0x0
    1313        RenderText {#text} at (0,0) size 0x0
    14 layer at (13,47) size 165x21
    15   RenderBlock {DIV} at (3,3) size 165x21
     14layer at (13,47) size 170x21
     15  RenderBlock {DIV} at (3,3) size 170x21
    1616    RenderText {#text} at (1,0) size 12x21
    1717      text run at (1,0) width 12: "1"
    18 layer at (179,46) size 0x23
    19   RenderBlock (relative positioned) {DIV} at (169,2) size 0x23
    20 layer at (183,44) size 19x27
    21   RenderBlock (relative positioned) {DIV} at (173,0) size 19x27
     18layer at (184,46) size 19x23
     19  RenderBlock (relative positioned) {DIV} at (174,2) size 19x23
    2220caret: position 1 of child 0 {#text} of child 0 {DIV} of {#shadow-root} of child 5 {INPUT} of body
  • trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.txt

    r83145 r87881  
    99      RenderTextControl {INPUT} at (135,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1010      RenderText {#text} at (0,0) size 0x0
    11 layer at (13,13) size 101x13
    12   RenderBlock {DIV} at (3,3) size 101x13
    13 layer at (146,13) size 101x13
    14   RenderBlock {DIV} at (3,3) size 101x13
    15 layer at (119,12) size 13x15
    16   RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
     11layer at (13,13) size 106x13
     12  RenderBlock {DIV} at (3,3) size 106x13
     13layer at (146,13) size 106x13
     14  RenderBlock {DIV} at (3,3) size 106x13
     15layer at (120,12) size 13x15
     16  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
  • trunk/Source/WebCore/ChangeLog

    r87880 r87881  
     12011-06-01  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Remove outer-spin-button
     6        https://bugs.webkit.org/show_bug.cgi?id=61845
     7
     8        Remove outer-spin-button, and render steppers as inner-spin-button.
     9        Outer-spin-button have never worked well with padding and border of
     10        <input>, and the layout code is very tricky and very hard to maintain it.
     11
     12        * css/CSSPrimitiveValueMappings.h:
     13        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     14        * css/CSSValueKeywords.in:
     15        * css/html.css:
     16        * html/HTMLInputElement.cpp:
     17        (WebCore::HTMLInputElement::innerSpinButtonElement):
     18        * html/HTMLInputElement.h:
     19        * html/InputType.h:
     20        * html/TextFieldInputType.cpp:
     21        (WebCore::TextFieldInputType::TextFieldInputType):
     22        (WebCore::TextFieldInputType::createShadowSubtree):
     23        (WebCore::TextFieldInputType::destroyShadowSubtree):
     24        * html/TextFieldInputType.h:
     25        * html/shadow/TextControlInnerElements.cpp:
     26        (WebCore::SpinButtonElement::SpinButtonElement):
     27        (WebCore::SpinButtonElement::create):
     28        (WebCore::SpinButtonElement::shadowPseudoId):
     29        * html/shadow/TextControlInnerElements.h:
     30        * platform/ThemeTypes.h:
     31        * platform/chromium/ThemeChromiumMac.mm:
     32        (WebCore::paintStepper):
     33         Center the stepper drawing area because the specified area can be
     34         larger than the NSStepper sizes.
     35        (WebCore::ThemeChromiumMac::controlSize):
     36        (WebCore::ThemeChromiumMac::minimumControlSize):
     37        (WebCore::ThemeChromiumMac::inflateControlPaintRect):
     38        (WebCore::ThemeChromiumMac::paint):
     39        * platform/mac/ThemeMac.mm:
     40        (WebCore::paintStepper):
     41         Center the stepper drawing area because the specified area can be
     42         larger than the NSStepper sizes.
     43        (WebCore::ThemeMac::controlSize):
     44        (WebCore::ThemeMac::minimumControlSize):
     45        (WebCore::ThemeMac::inflateControlPaintRect):
     46        (WebCore::ThemeMac::paint):
     47        * rendering/RenderBox.cpp:
     48        (WebCore::RenderBox::paintBoxDecorations):
     49        * rendering/RenderBox.h:
     50        * rendering/RenderTextControlSingleLine.cpp:
     51        (WebCore::RenderTextControlSingleLine::layout):
     52        (WebCore::RenderTextControlSingleLine::nodeAtPoint):
     53        (WebCore::RenderTextControlSingleLine::textBlockWidth):
     54        * rendering/RenderTextControlSingleLine.h:
     55        * rendering/RenderTheme.cpp:
     56        (WebCore::RenderTheme::adjustStyle):
     57        (WebCore::RenderTheme::paint):
     58        (WebCore::RenderTheme::adjustInnerSpinButtonStyle):
     59        * rendering/RenderTheme.h:
     60        * rendering/RenderThemeMac.mm:
     61        (WebCore::RenderThemeMac::adjustRepaintRect):
     62
    1632011-06-01  Emil A Eklund  <eae@chromium.org>
    264
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r87121 r87881  
    302302            m_value.ident = CSSValueRatingLevelIndicator;
    303303            break;
    304         case OuterSpinButtonPart:
    305             m_value.ident = CSSValueOuterSpinButton;
    306             break;
    307304        case ProgressBarPart:
    308305#if ENABLE(PROGRESS_TAG)
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r87121 r87881  
    600600menulist-textfield
    601601meter
    602 outer-spin-button
    603602progress-bar
    604603progress-bar-value
  • trunk/Source/WebCore/css/html.css

    r87372 r87881  
    455455}
    456456
    457 input::-webkit-outer-spin-button {
    458     -webkit-appearance: outer-spin-button;
    459     display: inline-block;
    460     position: relative;
    461     cursor: default;
    462     margin-left: 2px;
    463     vertical-align: top;
    464     -webkit-user-select: none;
    465 }
    466 
    467457#if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
    468458input::-webkit-input-speech-button {
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r87371 r87881  
    142142{
    143143    return m_inputType->innerSpinButtonElement();
    144 }
    145 
    146 HTMLElement* HTMLInputElement::outerSpinButtonElement() const
    147 {
    148     return m_inputType->outerSpinButtonElement();
    149144}
    150145
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r87371 r87881  
    112112    HTMLElement* innerBlockElement() const;
    113113    HTMLElement* innerSpinButtonElement() const;
    114     HTMLElement* outerSpinButtonElement() const;
    115114    HTMLElement* resultsButtonElement() const;
    116115    HTMLElement* cancelButtonElement() const;
  • trunk/Source/WebCore/html/InputType.h

    r87371 r87881  
    192192    virtual HTMLElement* innerTextElement() const { return 0; }
    193193    virtual HTMLElement* innerSpinButtonElement() const { return 0; }
    194     virtual HTMLElement* outerSpinButtonElement() const { return 0; }
    195194    virtual HTMLElement* resultsButtonElement() const { return 0; }
    196195    virtual HTMLElement* cancelButtonElement() const { return 0; }
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r87067 r87881  
    5252    , m_innerText(0)
    5353    , m_innerSpinButton(0)
    54     , m_outerSpinButton(0)
    5554#if ENABLE(INPUT_SPEECH)
    5655    , m_speechButton(0)
     
    135134    ASSERT(!m_innerText);
    136135    ASSERT(!m_innerSpinButton);
    137     ASSERT(!m_outerSpinButton);
    138136
    139137    bool shouldHaveSpinButton = RenderTheme::themeForPage(element()->document()->page())->shouldHaveSpinButton(element());
     
    162160
    163161    if (shouldHaveSpinButton) {
    164         RefPtr<HTMLElement> inner = SpinButtonElement::createInner(document);
    165         RefPtr<HTMLElement> outer = SpinButtonElement::createOuter(document);
     162        RefPtr<HTMLElement> inner = SpinButtonElement::create(document);
    166163        m_innerSpinButton = inner.get();
    167         m_outerSpinButton = outer.get();
    168164        element()->ensureShadowRoot()->appendChild(inner.release(), ec);
    169         element()->ensureShadowRoot()->appendChild(outer.release(), ec);
    170165    }
    171166}
     
    179174#endif
    180175    m_innerSpinButton = 0;
    181     m_outerSpinButton = 0;
    182176}
    183177
  • trunk/Source/WebCore/html/TextFieldInputType.h

    r87067 r87881  
    4848    virtual HTMLElement* innerTextElement() const { return m_innerText; }
    4949    virtual HTMLElement* innerSpinButtonElement() const { return m_innerSpinButton; }
    50     virtual HTMLElement* outerSpinButtonElement() const { return m_outerSpinButton; }
    5150#if ENABLE(INPUT_SPEECH)
    5251    virtual HTMLElement* speechButtonElement() const { return m_speechButton; }
     
    7473    HTMLElement* m_innerText;
    7574    HTMLElement* m_innerSpinButton;
    76     HTMLElement* m_outerSpinButton;
    7775#if ENABLE(INPUT_SPEECH)
    7876    HTMLElement* m_speechButton;
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r87235 r87881  
    224224// ----------------------------
    225225
    226 inline SpinButtonElement::SpinButtonElement(Document* document, bool isInner)
     226inline SpinButtonElement::SpinButtonElement(Document* document)
    227227    : HTMLDivElement(divTag, document)
    228     , m_isInner(isInner)
    229228    , m_capturing(false)
    230229    , m_upDownState(Indeterminate)
     
    234233}
    235234
    236 PassRefPtr<SpinButtonElement> SpinButtonElement::createInner(Document* document)
    237 {
    238     return adoptRef(new SpinButtonElement(document, true));
    239 }
    240 
    241 PassRefPtr<SpinButtonElement> SpinButtonElement::createOuter(Document* document)
    242 {
    243     return adoptRef(new SpinButtonElement(document, false));
     235PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document* document)
     236{
     237    return adoptRef(new SpinButtonElement(document));
    244238}
    245239
     
    247241{
    248242    DEFINE_STATIC_LOCAL(AtomicString, innerPseudoId, ("-webkit-inner-spin-button"));
    249     DEFINE_STATIC_LOCAL(AtomicString, outerPseudoId, ("-webkit-outer-spin-button"));
    250     return m_isInner ? innerPseudoId : outerPseudoId;
     243    return innerPseudoId;
    251244}
    252245
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.h

    r87235 r87881  
    9797    };
    9898
    99     static PassRefPtr<SpinButtonElement> createInner(Document*);
    100     static PassRefPtr<SpinButtonElement> createOuter(Document*);
     99    static PassRefPtr<SpinButtonElement> create(Document*);
    101100    UpDownState upDownState() const { return m_upDownState; }
    102101
    103102private:
    104     SpinButtonElement(Document*, bool isInner);
     103    SpinButtonElement(Document*);
    105104
    106105    virtual const AtomicString& shadowPseudoId() const;
     
    116115    virtual bool isMouseFocusable() const { return false; }
    117116
    118     bool m_isInner;
    119117    bool m_capturing;
    120118    UpDownState m_upDownState;
  • trunk/Source/WebCore/platform/ThemeTypes.h

    r74099 r87881  
    5353    MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
    5454    MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaControlsFullscreenBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
    55     MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, OuterSpinButtonPart, ProgressBarPart, ProgressBarValuePart,
     55    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, ProgressBarPart, ProgressBarValuePart,
    5656    SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart,
    5757    SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart,
  • trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm

    r87821 r87881  
    651651    }
    652652    CGRect bounds(rect);
    653     // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
    654653    CGRect backgroundBounds;
    655654    HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
    656     if (bounds.origin.x != backgroundBounds.origin.x)
    657         bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
    658     if (bounds.origin.y != backgroundBounds.origin.y)
    659         bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
     655    // Center the stepper rectangle in the specified area.
     656    backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
     657    if (backgroundBounds.size.height < bounds.size.height) {
     658        int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
     659        backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
     660    }
    660661#if USE(SKIA)
    661662    gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas());
     
    664665    CGContextRef cgContext = context->platformContext();
    665666#endif
     667    HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
    666668    HIThemeDrawButton(&bounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0);
    667669    context->restore();
     
    711713#endif
    712714        case InnerSpinButtonPart:
    713             // We don't use inner spin buttons on Mac.
    714             return LengthSize(Length(Fixed), Length(Fixed));
    715         case OuterSpinButtonPart:
    716715            if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
    717716                return zoomedSize;
     
    730729        case ListButtonPart:
    731730            return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
    732         case InnerSpinButtonPart:
    733             // We don't use inner spin buttons on Mac.
    734             return LengthSize(Length(Fixed), Length(Fixed));
    735         case OuterSpinButtonPart: {
     731        case InnerSpinButtonPart: {
    736732            IntSize base = stepperSizes()[NSMiniControlSize];
    737733            return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
     
    814810            break;
    815811        }
    816         case OuterSpinButtonPart: {
     812        case InnerSpinButtonPart: {
    817813            static const int stepperMargin[4] = { 0, 0, 0, 0 };
    818814            ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
     
    845841            paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
    846842            break;
    847         case OuterSpinButtonPart:
     843        case InnerSpinButtonPart:
    848844            paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
    849845            break;
  • trunk/Source/WebCore/platform/mac/ThemeMac.mm

    r84504 r87881  
    538538    }
    539539    CGRect bounds(rect);
    540     // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
    541540    CGRect backgroundBounds;
    542541    HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
    543     if (bounds.origin.x != backgroundBounds.origin.x)
    544         bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
    545     if (bounds.origin.y != backgroundBounds.origin.y)
    546         bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
    547     HIThemeDrawButton(&bounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
     542    // Center the stepper rectangle in the specified area.
     543    backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
     544    if (backgroundBounds.size.height < bounds.size.height) {
     545        int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
     546        backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
     547    }
     548    HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
    548549}
    549550
     
    604605#endif
    605606        case InnerSpinButtonPart:
    606             // We don't use inner spin buttons on Mac.
    607             return LengthSize(Length(Fixed), Length(Fixed));
    608         case OuterSpinButtonPart:
    609607            if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
    610608                return zoomedSize;
     
    623621        case ListButtonPart:
    624622            return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
    625         case InnerSpinButtonPart:
    626             // We don't use inner spin buttons on Mac.
    627             return LengthSize(Length(Fixed), Length(Fixed));
    628         case OuterSpinButtonPart: {
     623        case InnerSpinButtonPart:{
    629624            IntSize base = stepperSizes()[NSMiniControlSize];
    630625            return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
     
    707702            break;
    708703        }
    709         case OuterSpinButtonPart: {
     704        case InnerSpinButtonPart: {
    710705            static const int stepperMargin[4] = { 0, 0, 0, 0 };
    711706            ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
     
    738733            paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
    739734            break;
    740         case OuterSpinButtonPart:
     735        case InnerSpinButtonPart:
    741736            paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
    742737            break;
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r87866 r87881  
    803803}
    804804
    805 void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
    806 {
    807     if (paintInfo.shouldPaintWithinRoot(this))
    808         paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width(), height()));
    809 }
    810 
    811805BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const
    812806{
     
    832826}
    833827
    834 void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, IntRect paintRect)
    835 {
     828void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
     829{
     830    if (!paintInfo.shouldPaintWithinRoot(this))
     831        return;
     832    IntRect paintRect(tx, ty, width(), height());
     833
    836834    // border-fit can adjust where we paint our border and background.  If set, we snugly fit our line box descendants.  (The iChat
    837835    // balloon layout is an example of this).
  • trunk/Source/WebCore/rendering/RenderBox.h

    r87866 r87881  
    418418    void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
    419419
    420     void paintBoxDecorationsWithSize(PaintInfo&, IntRect);
    421420    void paintMaskImages(const PaintInfo&, const IntRect&);
    422421
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r87443 r87881  
    104104}
    105105
    106 inline HTMLElement* RenderTextControlSingleLine::outerSpinButtonElement() const
    107 {
    108     return inputElement()->outerSpinButtonElement();
    109 }
    110 
    111106inline HTMLElement* RenderTextControlSingleLine::resultsButtonElement() const
    112107{
     
    257252}
    258253
    259 void RenderTextControlSingleLine::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
    260 {
    261     paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width() - decorationWidthRight(), height()));
    262 }
    263 
    264 void RenderTextControlSingleLine::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
    265 {
    266     int w = width() - decorationWidthRight();
    267     if (w && height())
    268         rects.append(IntRect(additionalOffset, IntSize(w, height())));
    269 }
    270 
    271254void RenderTextControlSingleLine::layout()
    272255{
     
    333316        } else {
    334317            int x = width() - borderRight() - paddingRight() - button->width();
    335             if (outerSpinButtonElement() && outerSpinButtonElement()->renderBox())
    336                 x -= outerSpinButtonElement()->renderBox()->width();
    337 
    338318            RenderBox* spinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0;
    339319            if (style()->isLeftToRightDirection())
     
    346326    }
    347327#endif
    348 
    349     // Center the spin button vertically, and move it to the right by
    350     // padding + border of the text fields.
    351     HTMLElement* outerSpinButton = outerSpinButtonElement();
    352     if (RenderBox* spinBox = outerSpinButton ? outerSpinButton->renderBox() : 0) {
    353         int diff = height() - spinBox->height();
    354         // If the diff is odd, the top area over the spin button takes the
    355         // remaining one pixel. It's good for Mac NSStepper because it has
    356         // shadow at the bottom.
    357         int y = (diff / 2) + (diff % 2);
    358         int x = width() - borderRight() - paddingRight() - spinBox->width();
    359         spinBox->setLocation(IntPoint(x, y));
    360     }
    361328}
    362329
     
    381348    HTMLElement* innerSpinButton = innerSpinButtonElement();
    382349    if (innerSpinButton && result.innerNode() == innerSpinButton)
    383         return true;
    384     HTMLElement* outerSpinButton = outerSpinButtonElement();
    385     if (outerSpinButton && result.innerNode() == outerSpinButton)
    386350        return true;
    387351#if ENABLE(INPUT_SPEECH)
     
    559523#endif
    560524
    561     return width - decorationWidthRight();
    562 }
    563 
    564 int RenderTextControlSingleLine::decorationWidthRight() const
    565 {
    566     int width = 0;
    567     HTMLElement* outerSpinButton = outerSpinButtonElement();
    568     if (RenderBox* spinRenderer = outerSpinButton ? outerSpinButton->renderBox() : 0) {
    569         spinRenderer->computeLogicalWidth();
    570         width += spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight();
    571     }
    572     if (width > 0)
    573         width += paddingRight() + borderRight();
    574525    return width;
    575526}
    576    
     527
    577528float RenderTextControlSingleLine::getAvgCharWidth(AtomicString family)
    578529{
     
    628579#endif
    629580    return result;
    630 }
    631 
    632 int RenderTextControlSingleLine::preferredDecorationWidthRight() const
    633 {
    634     int width = 0;
    635     HTMLElement* outerSpinButton = outerSpinButtonElement();
    636     if (RenderBox* spinRenderer = outerSpinButton ? outerSpinButton->renderBox() : 0) {
    637         spinRenderer->computeLogicalWidth();
    638         width += spinRenderer->minPreferredLogicalWidth() + spinRenderer->marginLeft() + spinRenderer->marginRight();
    639     }
    640     if (width > 0)
    641         width += paddingRight() + borderRight();
    642     return width;
    643581}
    644582
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r87443 r87881  
    5656    void capsLockStateMayHaveChanged();
    5757
    58     // Decoration width outside of the text field.
    59     int decorationWidthRight() const;
    60 
    6158private:
    62     int preferredDecorationWidthRight() const;
    6359    virtual bool hasControlClip() const;
    6460    virtual IntRect controlClipRect(const IntPoint&) const;
     
    6763    virtual void subtreeHasChanged();
    6864    virtual void paint(PaintInfo&, int tx, int ty);
    69     virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
    70     virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
    7165    virtual void layout();
    7266
     
    141135    HTMLElement* innerBlockElement() const;
    142136    HTMLElement* innerSpinButtonElement() const;
    143     HTMLElement* outerSpinButtonElement() const;
    144137    HTMLElement* resultsButtonElement() const;
    145138    HTMLElement* cancelButtonElement() const;
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r85998 r87881  
    101101        case CheckboxPart:
    102102        case InnerSpinButtonPart:
    103         case OuterSpinButtonPart:
    104103        case RadioPart:
    105104        case PushButtonPart:
     
    193192        case InnerSpinButtonPart:
    194193            return adjustInnerSpinButtonStyle(selector, style, e);
    195         case OuterSpinButtonPart:
    196             return adjustOuterSpinButtonStyle(selector, style, e);
    197194#endif
    198195        case TextFieldPart:
     
    268265        case ButtonPart:
    269266        case InnerSpinButtonPart:
    270         case OuterSpinButtonPart:
    271267            m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), o->view()->frameView());
    272268            return false;
     
    291287        case InnerSpinButtonPart:
    292288            return paintInnerSpinButton(o, paintInfo, r);
    293         case OuterSpinButtonPart:
    294             return paintOuterSpinButton(o, paintInfo, r);
    295289#endif
    296290        case MenulistPart:
     
    896890{
    897891}
    898 
    899 void RenderTheme::adjustOuterSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const
    900 {
    901 }
    902 
    903892#endif
    904893
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r85998 r87881  
    236236    virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    237237    virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    238     virtual void adjustOuterSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
    239     virtual bool paintOuterSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
    240238#endif
    241239
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r86274 r87881  
    508508        case DefaultButtonPart:
    509509        case ButtonPart:
    510         case OuterSpinButtonPart:
     510        case InnerSpinButtonPart:
    511511            return RenderTheme::adjustRepaintRect(o, r);
    512512        default:
Note: See TracChangeset for help on using the changeset viewer.