2011-06-01 Kent Tamura <tkent@chromium.org>
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2011 07:04:05 +0000 (07:04 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2011 07:04:05 +0000 (07:04 +0000)
        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87881 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.png
LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/html.css
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/InputType.h
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/TextFieldInputType.h
Source/WebCore/html/shadow/TextControlInnerElements.cpp
Source/WebCore/html/shadow/TextControlInnerElements.h
Source/WebCore/platform/ThemeTypes.h
Source/WebCore/platform/chromium/ThemeChromiumMac.mm
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMac.mm

index 146895890d06cebb93f27d9edca67130e10be262..370b72f1a633a035db0746fa40d9d55e1e47da44 100644 (file)
@@ -1,3 +1,24 @@
+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  Adam Barth  <abarth@webkit.org>
 
         There seems to be something odd about registerProtocolHandler on Mac.
index 3ff35f7078370e892eed32137f7b5cd9c9e2e24d..6ae586fb4c62369cd02b82f3d990c0b0c1e9057c 100644 (file)
@@ -3875,6 +3875,8 @@ BUGCR82891 LINUX : fast/speech/input-appearance-numberandspeech.html = IMAGE+TEX
 BUGCR82891 LINUX : fast/speech/input-appearance-searchandspeech.html = FAIL PASS
 BUGCR82891 LINUX : fast/speech/input-appearance-speechbutton.html = IMAGE+TEXT PASS
 BUGWK59208 WIN MAC : fast/speech/input-appearance-searchandspeech.html = FAIL
+// Need rebaseline.
+BUGWK61845 MAC : fast/speech/input-appearance-numberandspeech.html = FAIL
 
 // Fails on windows - added in r86693
 BUGCR82950 WIN : http/tests/navigation/post-301-response.html = TEXT
index e30eeae902d721337f42ad16d559550f7a679259..b107837b6e802d2a02fa79aff5ff118e20f3d9a0 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.png differ
index 11bfc490aa0164b7bb624344d88cb4aaa3b0fa5f..a2d91dea3137cc1697d187184ed669923fc5258e 100644 (file)
@@ -21,21 +21,21 @@ layer at (0,0) size 800x600
           RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
           RenderText {#text} at (222,10) size 102x18
             text run at (222,10) width 102: " Read-only state"
-layer at (13,47) size 188x23
-  RenderBlock {DIV} at (3,3) size 188x23
+layer at (13,47) size 193x23
+  RenderBlock {DIV} at (3,3) size 193x23
     RenderText {#text} at (1,0) size 13x23
       text run at (1,0) width 13: "0"
-layer at (13,80) size 188x23
-  RenderBlock {DIV} at (3,3) size 188x23 [color=#545454]
+layer at (13,80) size 193x23
+  RenderBlock {DIV} at (3,3) size 193x23 [color=#545454]
     RenderText {#text} at (1,0) size 13x23
       text run at (1,0) width 13: "0"
-layer at (13,113) size 188x23
-  RenderBlock {DIV} at (3,3) size 188x23
+layer at (13,113) size 193x23
+  RenderBlock {DIV} at (3,3) size 193x23
     RenderText {#text} at (1,0) size 13x23
       text run at (1,0) width 13: "0"
-layer at (206,45) size 19x27
-  RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
-layer at (206,78) size 19x27
-  RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
-layer at (206,111) size 19x27
-  RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
+layer at (207,46) size 19x25
+  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
+layer at (207,79) size 19x25
+  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
+layer at (207,112) size 19x25
+  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
index ad5e574ae1f8d06cf35ba2a15c079ff6192fa7f5..8e12d206bc56b678035e8d806338dedac031a973 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.png and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.png differ
index 2368ec16ae9ffc84895a8b462852f05b2c7ef299..b36e5bd3fc2fca02b15105c72d13ba8e77836bdc 100644 (file)
@@ -111,97 +111,97 @@ layer at (0,0) size 800x600
                   RenderTextControl {INPUT} at (2,39) size 243x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
 layer at (14,129) size 94x10
   RenderBlock {DIV} at (3,3) size 94x10
-layer at (14,145) size 76x10
-  RenderBlock {DIV} at (3,3) size 76x10
+layer at (14,145) size 81x10
+  RenderBlock {DIV} at (3,3) size 81x10
 layer at (14,163) size 96x11
   RenderBlock {DIV} at (3,3) size 96x11
-layer at (14,180) size 78x11
-  RenderBlock {DIV} at (3,3) size 78x11
+layer at (14,180) size 83x11
+  RenderBlock {DIV} at (3,3) size 83x11
 layer at (14,198) size 98x12
   RenderBlock {DIV} at (3,3) size 98x12
-layer at (14,216) size 80x12
-  RenderBlock {DIV} at (3,3) size 80x12
+layer at (14,216) size 85x12
+  RenderBlock {DIV} at (3,3) size 85x12
 layer at (16,236) size 119x13
   RenderBlock {DIV} at (3,3) size 119x13
-layer at (16,259) size 101x13
-  RenderBlock {DIV} at (3,3) size 101x13
+layer at (16,259) size 106x13
+  RenderBlock {DIV} at (3,3) size 106x13
 layer at (16,282) size 121x15
   RenderBlock {DIV} at (3,3) size 121x15
-layer at (16,307) size 103x15
-  RenderBlock {DIV} at (3,3) size 103x15
+layer at (16,307) size 108x15
+  RenderBlock {DIV} at (3,3) size 108x15
 layer at (16,332) size 142x16
   RenderBlock {DIV} at (3,3) size 142x16
-layer at (16,358) size 122x16
-  RenderBlock {DIV} at (3,3) size 122x16
+layer at (16,358) size 127x16
+  RenderBlock {DIV} at (3,3) size 127x16
 layer at (16,384) size 144x17
   RenderBlock {DIV} at (3,3) size 144x17
-layer at (16,411) size 124x17
-  RenderBlock {DIV} at (3,3) size 124x17
+layer at (16,411) size 129x17
+  RenderBlock {DIV} at (3,3) size 129x17
 layer at (16,438) size 164x18
   RenderBlock {DIV} at (3,3) size 164x18
-layer at (16,466) size 144x18
-  RenderBlock {DIV} at (3,3) size 144x18
+layer at (16,466) size 149x18
+  RenderBlock {DIV} at (3,3) size 149x18
 layer at (198,50) size 166x18
   RenderBlock {DIV} at (3,3) size 166x18
-layer at (198,78) size 146x18
-  RenderBlock {DIV} at (3,3) size 146x18
+layer at (198,78) size 151x18
+  RenderBlock {DIV} at (3,3) size 151x18
 layer at (198,106) size 168x20
   RenderBlock {DIV} at (3,3) size 168x20
-layer at (198,136) size 148x20
-  RenderBlock {DIV} at (3,3) size 148x20
+layer at (198,136) size 153x20
+  RenderBlock {DIV} at (3,3) size 153x20
 layer at (198,166) size 189x21
   RenderBlock {DIV} at (3,3) size 189x21
-layer at (198,197) size 165x21
-  RenderBlock {DIV} at (3,3) size 165x21
+layer at (198,197) size 170x21
+  RenderBlock {DIV} at (3,3) size 170x21
 layer at (198,228) size 191x22
   RenderBlock {DIV} at (3,3) size 191x22
-layer at (198,260) size 167x22
-  RenderBlock {DIV} at (3,3) size 167x22
+layer at (198,260) size 172x22
+  RenderBlock {DIV} at (3,3) size 172x22
 layer at (198,292) size 212x23
   RenderBlock {DIV} at (3,3) size 212x23
-layer at (198,325) size 188x23
-  RenderBlock {DIV} at (3,3) size 188x23
+layer at (198,325) size 193x23
+  RenderBlock {DIV} at (3,3) size 193x23
 layer at (198,358) size 214x24
   RenderBlock {DIV} at (3,3) size 214x24
-layer at (198,392) size 190x24
-  RenderBlock {DIV} at (3,3) size 190x24
+layer at (198,392) size 195x24
+  RenderBlock {DIV} at (3,3) size 195x24
 layer at (198,426) size 235x26
   RenderBlock {DIV} at (3,3) size 235x26
-layer at (198,462) size 211x26
-  RenderBlock {DIV} at (3,3) size 211x26
+layer at (198,462) size 216x26
+  RenderBlock {DIV} at (3,3) size 216x26
 layer at (198,498) size 237x27
   RenderBlock {DIV} at (3,3) size 237x27
-layer at (198,535) size 213x27
-  RenderBlock {DIV} at (3,3) size 213x27
-layer at (95,143) size 13x15
-  RenderBlock (relative positioned) {DIV} at (84,1) size 13x15
-layer at (97,178) size 13x15
-  RenderBlock (relative positioned) {DIV} at (86,1) size 13x15
-layer at (99,215) size 13x15
-  RenderBlock (relative positioned) {DIV} at (88,2) size 13x15
-layer at (122,258) size 13x15
-  RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
-layer at (124,307) size 13x15
-  RenderBlock (relative positioned) {DIV} at (111,3) size 13x15
-layer at (143,355) size 15x22
-  RenderBlock (relative positioned) {DIV} at (130,0) size 15x22
-layer at (145,409) size 15x22
-  RenderBlock (relative positioned) {DIV} at (132,1) size 15x22
-layer at (165,464) size 15x22
-  RenderBlock (relative positioned) {DIV} at (152,1) size 15x22
-layer at (349,76) size 15x22
-  RenderBlock (relative positioned) {DIV} at (154,1) size 15x22
-layer at (351,135) size 15x22
-  RenderBlock (relative positioned) {DIV} at (156,2) size 15x22
-layer at (368,194) size 19x27
-  RenderBlock (relative positioned) {DIV} at (173,0) size 19x27
-layer at (370,258) size 19x27
-  RenderBlock (relative positioned) {DIV} at (175,1) size 19x27
-layer at (391,323) size 19x27
-  RenderBlock (relative positioned) {DIV} at (196,1) size 19x27
-layer at (393,391) size 19x27
-  RenderBlock (relative positioned) {DIV} at (198,2) size 19x27
-layer at (414,462) size 19x27
-  RenderBlock (relative positioned) {DIV} at (219,3) size 19x27
-layer at (416,535) size 19x27
-  RenderBlock (relative positioned) {DIV} at (221,3) size 19x27
+layer at (198,535) size 218x27
+  RenderBlock {DIV} at (3,3) size 218x27
+layer at (96,144) size 13x12
+  RenderBlock (relative positioned) {DIV} at (85,2) size 13x12
+layer at (98,179) size 13x13
+  RenderBlock (relative positioned) {DIV} at (87,2) size 13x13
+layer at (100,215) size 13x14
+  RenderBlock (relative positioned) {DIV} at (89,2) size 13x14
+layer at (123,258) size 13x15
+  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
+layer at (125,306) size 13x17
+  RenderBlock (relative positioned) {DIV} at (112,2) size 13x17
+layer at (144,357) size 15x18
+  RenderBlock (relative positioned) {DIV} at (131,2) size 15x18
+layer at (146,410) size 15x19
+  RenderBlock (relative positioned) {DIV} at (133,2) size 15x19
+layer at (166,465) size 15x20
+  RenderBlock (relative positioned) {DIV} at (153,2) size 15x20
+layer at (350,77) size 15x20
+  RenderBlock (relative positioned) {DIV} at (155,2) size 15x20
+layer at (352,135) size 15x22
+  RenderBlock (relative positioned) {DIV} at (157,2) size 15x22
+layer at (369,196) size 19x23
+  RenderBlock (relative positioned) {DIV} at (174,2) size 19x23
+layer at (371,259) size 19x24
+  RenderBlock (relative positioned) {DIV} at (176,2) size 19x24
+layer at (392,324) size 19x25
+  RenderBlock (relative positioned) {DIV} at (197,2) size 19x25
+layer at (394,391) size 19x26
+  RenderBlock (relative positioned) {DIV} at (199,2) size 19x26
+layer at (415,461) size 19x28
+  RenderBlock (relative positioned) {DIV} at (220,2) size 19x28
+layer at (417,534) size 19x29
+  RenderBlock (relative positioned) {DIV} at (222,2) size 19x29
index ecd7a9b4b065225c2a576f3e7b6e69b5d6ded888..a7555faa5e7f013b7a150666580979a3401dbada 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-layer-expected.png differ
index 80580803a0da1bdc973cd6b1d20bc55fdc90661a..855c328735ceddc8da919dbb25c61f029dcdf012 100644 (file)
@@ -6,17 +6,17 @@ layer at (0,0) size 800x62
       RenderBR {BR} at (129,2) size 0x18
       RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
       RenderText {#text} at (0,0) size 0x0
-layer at (13,36) size 101x13
-  RenderBlock {DIV} at (3,3) size 101x13
+layer at (13,36) size 106x13
+  RenderBlock {DIV} at (3,3) size 106x13
     RenderText {#text} at (1,0) size 14x13
       text run at (1,0) width 14: "10"
 layer at (10,10) size 125x19
   RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-layer at (13,13) size 101x13
-  RenderBlock {DIV} at (3,3) size 101x13
+layer at (13,13) size 106x13
+  RenderBlock {DIV} at (3,3) size 106x13
     RenderText {#text} at (1,0) size 14x13
       text run at (1,0) width 14: "10"
-layer at (119,12) size 13x15
-  RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
-layer at (119,35) size 13x15
-  RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
+layer at (120,12) size 13x15
+  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
+layer at (120,35) size 13x15
+  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
index 673058e7a66ffb3decc2f33dbdd693875891806a..6fff56cecdba22af23249a485f62c62f6f66dd14 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.png and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.png differ
index 2b5b09676adf2e95dca4352f524e54ccbae4cd03..730a214ac5132b6b5857df48d1972fd78c66cd0a 100644 (file)
@@ -11,12 +11,10 @@ layer at (0,0) size 800x600
         RenderTextControl {INPUT} at (2,2) size 195x27 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
         RenderText {#text} at (0,0) size 0x0
         RenderText {#text} at (0,0) size 0x0
-layer at (13,47) size 165x21
-  RenderBlock {DIV} at (3,3) size 165x21
+layer at (13,47) size 170x21
+  RenderBlock {DIV} at (3,3) size 170x21
     RenderText {#text} at (1,0) size 12x21
       text run at (1,0) width 12: "1"
-layer at (179,46) size 0x23
-  RenderBlock (relative positioned) {DIV} at (169,2) size 0x23
-layer at (183,44) size 19x27
-  RenderBlock (relative positioned) {DIV} at (173,0) size 19x27
+layer at (184,46) size 19x23
+  RenderBlock (relative positioned) {DIV} at (174,2) size 19x23
 caret: position 1 of child 0 {#text} of child 0 {DIV} of {#shadow-root} of child 5 {INPUT} of body
index 5d431700b2b4842a56fb5bec8a320eebcec37333..846db828fd74b51a3d90c02c271eb6ea669f7cf0 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.png and b/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-visibility-expected.png differ
index 0574e7d702faec14ed79bed7f31cd87fb4cf8515..8167a7fd81fe8466d5bea1a490f4417ea410b401 100644 (file)
@@ -8,9 +8,9 @@ layer at (0,0) size 800x39
         text run at (129,2) width 4: " "
       RenderTextControl {INPUT} at (135,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
       RenderText {#text} at (0,0) size 0x0
-layer at (13,13) size 101x13
-  RenderBlock {DIV} at (3,3) size 101x13
-layer at (146,13) size 101x13
-  RenderBlock {DIV} at (3,3) size 101x13
-layer at (119,12) size 13x15
-  RenderBlock (relative positioned) {DIV} at (109,2) size 13x15
+layer at (13,13) size 106x13
+  RenderBlock {DIV} at (3,3) size 106x13
+layer at (146,13) size 106x13
+  RenderBlock {DIV} at (3,3) size 106x13
+layer at (120,12) size 13x15
+  RenderBlock (relative positioned) {DIV} at (110,2) size 13x15
index 9dbfdd89c2ef7d80c481027aa9bb02bcac67efd3..4e86ac90f47c0ad3136dfc6f8af687f16403bf3a 100644 (file)
@@ -1,3 +1,65 @@
+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):
+
 2011-06-01  Emil A Eklund  <eae@chromium.org>
 
         Reviewed by Eric Seidel.
index e3022e6fd0621f7d356ce7d45d60181ffe8ffa7a..86b8731c997c539087c8d1c953dd6a7d3e2d0948 100644 (file)
@@ -301,9 +301,6 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
         case RatingLevelIndicatorPart:
             m_value.ident = CSSValueRatingLevelIndicator;
             break;
-        case OuterSpinButtonPart:
-            m_value.ident = CSSValueOuterSpinButton;
-            break;
         case ProgressBarPart:
 #if ENABLE(PROGRESS_TAG)
             m_value.ident = CSSValueProgressBar;
index d670a62f4f20dd5a7a2d2ac0669a1a7e065c92e1..6879e53b28a08a540462c569a874cec3d5190b37 100644 (file)
@@ -599,7 +599,6 @@ menulist-button
 menulist-text
 menulist-textfield
 meter
-outer-spin-button
 progress-bar
 progress-bar-value
 slider-horizontal
index 0ec6603016844a0dbda4a8ded39ec13bb36b3a05..11d9cdd8b94e7887d6bf39f8444999edd8196648 100644 (file)
@@ -454,16 +454,6 @@ input::-webkit-inner-spin-button {
     -webkit-user-select: none;
 }
 
-input::-webkit-outer-spin-button {
-    -webkit-appearance: outer-spin-button;
-    display: inline-block;
-    position: relative;
-    cursor: default;
-    margin-left: 2px;
-    vertical-align: top;
-    -webkit-user-select: none;
-}
-
 #if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH
 input::-webkit-input-speech-button {
     -webkit-appearance: -webkit-input-speech-button;
index 3d9c7e02480a4f293f6edbe8aed7abd80c95e28b..94167546afe193b0efd1b6e868346cdaad81b1fa 100644 (file)
@@ -143,11 +143,6 @@ HTMLElement* HTMLInputElement::innerSpinButtonElement() const
     return m_inputType->innerSpinButtonElement();
 }
 
-HTMLElement* HTMLInputElement::outerSpinButtonElement() const
-{
-    return m_inputType->outerSpinButtonElement();
-}
-
 HTMLElement* HTMLInputElement::resultsButtonElement() const
 {
     return m_inputType->resultsButtonElement();
index 7affdfe4e45b9f96e9baef0b0928f56081178849..e3d0c3769102836ca2f45b92d27a9da096baedc0 100644 (file)
@@ -111,7 +111,6 @@ public:
     virtual HTMLElement* innerTextElement() const;
     HTMLElement* innerBlockElement() const;
     HTMLElement* innerSpinButtonElement() const;
-    HTMLElement* outerSpinButtonElement() const;
     HTMLElement* resultsButtonElement() const;
     HTMLElement* cancelButtonElement() const;
 #if ENABLE(INPUT_SPEECH)
index f2b8ac45e64d5280af6b03094b68e17d982a4fa9..71e2a08ef0651d5a729c8e2b4f40e034e656944b 100644 (file)
@@ -191,7 +191,6 @@ public:
     virtual HTMLElement* innerBlockElement() const { return 0; }
     virtual HTMLElement* innerTextElement() const { return 0; }
     virtual HTMLElement* innerSpinButtonElement() const { return 0; }
-    virtual HTMLElement* outerSpinButtonElement() const { return 0; }
     virtual HTMLElement* resultsButtonElement() const { return 0; }
     virtual HTMLElement* cancelButtonElement() const { return 0; }
 #if ENABLE(INPUT_SPEECH)
index 6230248729542267a72dbc2a7513276e1b315964..e5e7e0d65f48c66bbcac193faf693ca0688772ac 100644 (file)
@@ -51,7 +51,6 @@ TextFieldInputType::TextFieldInputType(HTMLInputElement* element)
     : InputType(element)
     , m_innerText(0)
     , m_innerSpinButton(0)
-    , m_outerSpinButton(0)
 #if ENABLE(INPUT_SPEECH)
     , m_speechButton(0)
 #endif
@@ -134,7 +133,6 @@ void TextFieldInputType::createShadowSubtree()
 {
     ASSERT(!m_innerText);
     ASSERT(!m_innerSpinButton);
-    ASSERT(!m_outerSpinButton);
 
     bool shouldHaveSpinButton = RenderTheme::themeForPage(element()->document()->page())->shouldHaveSpinButton(element());
     bool hasDecorations = shouldHaveSpinButton;
@@ -161,12 +159,9 @@ void TextFieldInputType::createShadowSubtree()
 #endif
 
     if (shouldHaveSpinButton) {
-        RefPtr<HTMLElement> inner = SpinButtonElement::createInner(document);
-        RefPtr<HTMLElement> outer = SpinButtonElement::createOuter(document);
+        RefPtr<HTMLElement> inner = SpinButtonElement::create(document);
         m_innerSpinButton = inner.get();
-        m_outerSpinButton = outer.get();
         element()->ensureShadowRoot()->appendChild(inner.release(), ec);
-        element()->ensureShadowRoot()->appendChild(outer.release(), ec);
     }
 }
 
@@ -178,7 +173,6 @@ void TextFieldInputType::destroyShadowSubtree()
     m_speechButton = 0;
 #endif
     m_innerSpinButton = 0;
-    m_outerSpinButton = 0;
 }
 
 bool TextFieldInputType::shouldUseInputMethod() const
index aa056cea159820189ed1f1fee2871fc89cc816cd..ecb660646e5969765a95bc35e602d127b25458ea 100644 (file)
@@ -47,7 +47,6 @@ protected:
 
     virtual HTMLElement* innerTextElement() const { return m_innerText; }
     virtual HTMLElement* innerSpinButtonElement() const { return m_innerSpinButton; }
-    virtual HTMLElement* outerSpinButtonElement() const { return m_outerSpinButton; }
 #if ENABLE(INPUT_SPEECH)
     virtual HTMLElement* speechButtonElement() const { return m_speechButton; }
 #endif
@@ -73,7 +72,6 @@ private:
 
     HTMLElement* m_innerText;
     HTMLElement* m_innerSpinButton;
-    HTMLElement* m_outerSpinButton;
 #if ENABLE(INPUT_SPEECH)
     HTMLElement* m_speechButton;
 #endif
index 406c2f3963488ea4040b9f37387ad37ed1edb61a..4cf62baa42bc9fa497964fac689590b1a56d5128 100644 (file)
@@ -223,9 +223,8 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
 
 // ----------------------------
 
-inline SpinButtonElement::SpinButtonElement(Document* document, bool isInner)
+inline SpinButtonElement::SpinButtonElement(Document* document)
     : HTMLDivElement(divTag, document)
-    , m_isInner(isInner)
     , m_capturing(false)
     , m_upDownState(Indeterminate)
     , m_pressStartingState(Indeterminate)
@@ -233,21 +232,15 @@ inline SpinButtonElement::SpinButtonElement(Document* document, bool isInner)
 {
 }
 
-PassRefPtr<SpinButtonElement> SpinButtonElement::createInner(Document* document)
+PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document* document)
 {
-    return adoptRef(new SpinButtonElement(document, true));
-}
-
-PassRefPtr<SpinButtonElement> SpinButtonElement::createOuter(Document* document)
-{
-    return adoptRef(new SpinButtonElement(document, false));
+    return adoptRef(new SpinButtonElement(document));
 }
 
 const AtomicString& SpinButtonElement::shadowPseudoId() const
 {
     DEFINE_STATIC_LOCAL(AtomicString, innerPseudoId, ("-webkit-inner-spin-button"));
-    DEFINE_STATIC_LOCAL(AtomicString, outerPseudoId, ("-webkit-outer-spin-button"));
-    return m_isInner ? innerPseudoId : outerPseudoId;
+    return innerPseudoId;
 }
 
 void SpinButtonElement::detach()
index c68e3de4f1a231e85a968fca8d46e214087e64dc..8b9b0aa3fae81c3c786a79bf8ed6a9df7d7d4c42 100644 (file)
@@ -96,12 +96,11 @@ public:
         Up,
     };
 
-    static PassRefPtr<SpinButtonElement> createInner(Document*);
-    static PassRefPtr<SpinButtonElement> createOuter(Document*);
+    static PassRefPtr<SpinButtonElement> create(Document*);
     UpDownState upDownState() const { return m_upDownState; }
 
 private:
-    SpinButtonElement(Document*, bool isInner);
+    SpinButtonElement(Document*);
 
     virtual const AtomicString& shadowPseudoId() const;
     virtual void detach();
@@ -115,7 +114,6 @@ private:
     virtual void setHovered(bool = true);
     virtual bool isMouseFocusable() const { return false; }
 
-    bool m_isInner;
     bool m_capturing;
     UpDownState m_upDownState;
     UpDownState m_pressStartingState;
index ec45cb79ff30e434013937f32af3fe915de22ab3..bdef724eb821f9cd6c481061dcfcfb8386da94f1 100644 (file)
@@ -52,7 +52,7 @@ enum ControlPart {
     MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
     MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
     MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaControlsFullscreenBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart,
-    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, OuterSpinButtonPart, ProgressBarPart, ProgressBarValuePart,
+    MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, ProgressBarPart, ProgressBarValuePart,
     SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart,
     SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart,
     SearchFieldResultsDecorationPart, SearchFieldResultsButtonPart,
index 961fa0126c4c61d9213b1dadd14f5720a37163a3..caf8042899b96a35bd2da78fc082c6926eb5349c 100644 (file)
@@ -650,19 +650,21 @@ static void paintStepper(ControlStates states, GraphicsContext* context, const I
         context->translate(-rect.x(), -rect.y());
     }
     CGRect bounds(rect);
-    // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
     CGRect backgroundBounds;
     HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
-    if (bounds.origin.x != backgroundBounds.origin.x)
-        bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
-    if (bounds.origin.y != backgroundBounds.origin.y)
-        bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
+    // Center the stepper rectangle in the specified area.
+    backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
+    if (backgroundBounds.size.height < bounds.size.height) {
+        int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
+        backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
+    }
 #if USE(SKIA)
     gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas());
     CGContextRef cgContext = bitLocker.cgContext();
 #else
     CGContextRef cgContext = context->platformContext();
 #endif
+    HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
     HIThemeDrawButton(&bounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0);
     context->restore();
 }
@@ -710,9 +712,6 @@ LengthSize ThemeChromiumMac::controlSize(ControlPart part, const Font& font, con
             return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, listButtonSizes());
 #endif
         case InnerSpinButtonPart:
-            // We don't use inner spin buttons on Mac.
-            return LengthSize(Length(Fixed), Length(Fixed));
-        case OuterSpinButtonPart:
             if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
                 return zoomedSize;
             return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
@@ -729,10 +728,7 @@ LengthSize ThemeChromiumMac::minimumControlSize(ControlPart part, const Font& fo
         case ButtonPart:
         case ListButtonPart:
             return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
-        case InnerSpinButtonPart:
-            // We don't use inner spin buttons on Mac.
-            return LengthSize(Length(Fixed), Length(Fixed));
-        case OuterSpinButtonPart: {
+        case InnerSpinButtonPart: {
             IntSize base = stepperSizes()[NSMiniControlSize];
             return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
                               Length(static_cast<int>(base.height() * zoomFactor), Fixed));
@@ -813,7 +809,7 @@ void ThemeChromiumMac::inflateControlPaintRect(ControlPart part, ControlStates s
             }
             break;
         }
-        case OuterSpinButtonPart: {
+        case InnerSpinButtonPart: {
             static const int stepperMargin[4] = { 0, 0, 0, 0 };
             ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
             IntSize zoomedSize = stepperSizes()[controlSize];
@@ -844,7 +840,7 @@ void ThemeChromiumMac::paint(ControlPart part, ControlStates states, GraphicsCon
         case ListButtonPart:
             paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
             break;
-        case OuterSpinButtonPart:
+        case InnerSpinButtonPart:
             paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
             break;
         default:
index b146cd34b86af177665d278688992816db754812..9cd42ecab909868104d6d423ee3ab8ac30816e6a 100644 (file)
@@ -537,14 +537,15 @@ static void paintStepper(ControlStates states, GraphicsContext* context, const I
         context->translate(-rect.x(), -rect.y());
     }
     CGRect bounds(rect);
-    // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
     CGRect backgroundBounds;
     HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
-    if (bounds.origin.x != backgroundBounds.origin.x)
-        bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
-    if (bounds.origin.y != backgroundBounds.origin.y)
-        bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
-    HIThemeDrawButton(&bounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
+    // Center the stepper rectangle in the specified area.
+    backgroundBounds.origin.x = bounds.origin.x + (bounds.size.width - backgroundBounds.size.width) / 2;
+    if (backgroundBounds.size.height < bounds.size.height) {
+        int heightDiff = clampToInteger(bounds.size.height - backgroundBounds.size.height);
+        backgroundBounds.origin.y = bounds.origin.y + (heightDiff / 2) + 1;
+    }
+    HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
 }
 
 // This will ensure that we always return a valid NSView, even if ScrollView doesn't have an associated document NSView.
@@ -603,9 +604,6 @@ LengthSize ThemeMac::controlSize(ControlPart part, const Font& font, const Lengt
             return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, listButtonSizes());
 #endif
         case InnerSpinButtonPart:
-            // We don't use inner spin buttons on Mac.
-            return LengthSize(Length(Fixed), Length(Fixed));
-        case OuterSpinButtonPart:
             if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
                 return zoomedSize;
             return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
@@ -622,10 +620,7 @@ LengthSize ThemeMac::minimumControlSize(ControlPart part, const Font& font, floa
         case ButtonPart:
         case ListButtonPart:
             return LengthSize(Length(0, Fixed), Length(static_cast<int>(15 * zoomFactor), Fixed));
-        case InnerSpinButtonPart:
-            // We don't use inner spin buttons on Mac.
-            return LengthSize(Length(Fixed), Length(Fixed));
-        case OuterSpinButtonPart: {
+        case InnerSpinButtonPart:{
             IntSize base = stepperSizes()[NSMiniControlSize];
             return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed),
                               Length(static_cast<int>(base.height() * zoomFactor), Fixed));
@@ -706,7 +701,7 @@ void ThemeMac::inflateControlPaintRect(ControlPart part, ControlStates states, I
             }
             break;
         }
-        case OuterSpinButtonPart: {
+        case InnerSpinButtonPart: {
             static const int stepperMargin[4] = { 0, 0, 0, 0 };
             ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
             IntSize zoomedSize = stepperSizes()[controlSize];
@@ -737,7 +732,7 @@ void ThemeMac::paint(ControlPart part, ControlStates states, GraphicsContext* co
         case ListButtonPart:
             paintButton(part, states, context, zoomedRect, zoomFactor, scrollView);
             break;
-        case OuterSpinButtonPart:
+        case InnerSpinButtonPart:
             paintStepper(states, context, zoomedRect, zoomFactor, scrollView);
             break;
         default:
index 09dcd7de5f29ae0c79ac049f2487f2bbc45ea720..1ac3043a14e97180e490b143f0f55b2958194546 100644 (file)
@@ -802,12 +802,6 @@ void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
     paintFillLayers(paintInfo, bgColor, bgLayer, view()->documentRect(), BackgroundBleedNone, CompositeSourceOver, bodyObject);
 }
 
-void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
-{
-    if (paintInfo.shouldPaintWithinRoot(this))
-        paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width(), height()));
-}
-
 BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const
 {
     if (context->paintingDisabled())
@@ -831,8 +825,12 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
     return BackgroundBleedUseTransparencyLayer;
 }
 
-void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, IntRect paintRect)
+void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
 {
+    if (!paintInfo.shouldPaintWithinRoot(this))
+        return;
+    IntRect paintRect(tx, ty, width(), height());
+
     // border-fit can adjust where we paint our border and background.  If set, we snugly fit our line box descendants.  (The iChat
     // balloon layout is an example of this).
     borderFitAdjust(paintRect);
index ee4b7627b9a88f7a864645ccb50ff908eeef9d23..b88dcd24168b2c1ddb0ee999816ee193f192762f 100644 (file)
@@ -417,7 +417,6 @@ protected:
     void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
     void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
 
-    void paintBoxDecorationsWithSize(PaintInfo&, IntRect);
     void paintMaskImages(const PaintInfo&, const IntRect&);
 
 #if PLATFORM(MAC)
index c0b660da35621d16c068f08d29f84aeeb7e6f3da..51b645276e0699b4eab08858888506561dc4743a 100644 (file)
@@ -103,11 +103,6 @@ inline HTMLElement* RenderTextControlSingleLine::innerSpinButtonElement() const
     return inputElement()->innerSpinButtonElement();
 }
 
-inline HTMLElement* RenderTextControlSingleLine::outerSpinButtonElement() const
-{
-    return inputElement()->outerSpinButtonElement();
-}
-
 inline HTMLElement* RenderTextControlSingleLine::resultsButtonElement() const
 {
     return inputElement()->resultsButtonElement();
@@ -256,18 +251,6 @@ void RenderTextControlSingleLine::paint(PaintInfo& paintInfo, int tx, int ty)
     }
 }
 
-void RenderTextControlSingleLine::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
-{
-    paintBoxDecorationsWithSize(paintInfo, IntRect(tx, ty, width() - decorationWidthRight(), height()));
-}
-
-void RenderTextControlSingleLine::addFocusRingRects(Vector<IntRect>& rects, const IntPoint& additionalOffset)
-{
-    int w = width() - decorationWidthRight();
-    if (w && height())
-        rects.append(IntRect(additionalOffset, IntSize(w, height())));
-}
-
 void RenderTextControlSingleLine::layout()
 {
     int oldHeight = height();
@@ -332,9 +315,6 @@ void RenderTextControlSingleLine::layout()
             button->setLocation(IntPoint(x, y));
         } else {
             int x = width() - borderRight() - paddingRight() - button->width();
-            if (outerSpinButtonElement() && outerSpinButtonElement()->renderBox())
-                x -= outerSpinButtonElement()->renderBox()->width();
-
             RenderBox* spinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0;
             if (style()->isLeftToRightDirection())
                 x -= spinBox ? spinBox->width() : 0;
@@ -345,19 +325,6 @@ void RenderTextControlSingleLine::layout()
         }
     }
 #endif
-
-    // Center the spin button vertically, and move it to the right by
-    // padding + border of the text fields.
-    HTMLElement* outerSpinButton = outerSpinButtonElement();
-    if (RenderBox* spinBox = outerSpinButton ? outerSpinButton->renderBox() : 0) {
-        int diff = height() - spinBox->height();
-        // If the diff is odd, the top area over the spin button takes the
-        // remaining one pixel. It's good for Mac NSStepper because it has
-        // shadow at the bottom.
-        int y = (diff / 2) + (diff % 2);
-        int x = width() - borderRight() - paddingRight() - spinBox->width();
-        spinBox->setLocation(IntPoint(x, y));
-    }
 }
 
 bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, int tx, int ty, HitTestAction hitTestAction)
@@ -381,9 +348,6 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
     HTMLElement* innerSpinButton = innerSpinButtonElement();
     if (innerSpinButton && result.innerNode() == innerSpinButton)
         return true;
-    HTMLElement* outerSpinButton = outerSpinButtonElement();
-    if (outerSpinButton && result.innerNode() == outerSpinButton)
-        return true;
 #if ENABLE(INPUT_SPEECH)
     HTMLElement* speechButton = speechButtonElement();
     if (speechButton && result.innerNode() == speechButton)
@@ -558,22 +522,9 @@ int RenderTextControlSingleLine::textBlockWidth() const
     }
 #endif
 
-    return width - decorationWidthRight();
-}
-
-int RenderTextControlSingleLine::decorationWidthRight() const
-{
-    int width = 0;
-    HTMLElement* outerSpinButton = outerSpinButtonElement();
-    if (RenderBox* spinRenderer = outerSpinButton ? outerSpinButton->renderBox() : 0) {
-        spinRenderer->computeLogicalWidth();
-        width += spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight();
-    }
-    if (width > 0)
-        width += paddingRight() + borderRight();
     return width;
 }
-    
+
 float RenderTextControlSingleLine::getAvgCharWidth(AtomicString family)
 {
     // Since Lucida Grande is the default font, we want this to match the width
@@ -629,19 +580,6 @@ int RenderTextControlSingleLine::preferredContentWidth(float charWidth) const
     return result;
 }
 
-int RenderTextControlSingleLine::preferredDecorationWidthRight() const
-{
-    int width = 0;
-    HTMLElement* outerSpinButton = outerSpinButtonElement();
-    if (RenderBox* spinRenderer = outerSpinButton ? outerSpinButton->renderBox() : 0) {
-        spinRenderer->computeLogicalWidth();
-        width += spinRenderer->minPreferredLogicalWidth() + spinRenderer->marginLeft() + spinRenderer->marginRight();
-    }
-    if (width > 0)
-        width += paddingRight() + borderRight();
-    return width;
-}
-
 void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineHeight)
 {
     HTMLElement* resultsButton = resultsButtonElement();
index 370d3a88e857acc1ad57b1dba57775e575e04afb..be47e73d52de591e9dfe9721f44213b3d1c84334 100644 (file)
@@ -55,19 +55,13 @@ public:
 
     void capsLockStateMayHaveChanged();
 
-    // Decoration width outside of the text field.
-    int decorationWidthRight() const;
-
 private:
-    int preferredDecorationWidthRight() const;
     virtual bool hasControlClip() const;
     virtual IntRect controlClipRect(const IntPoint&) const;
     virtual bool isTextField() const { return true; }
 
     virtual void subtreeHasChanged();
     virtual void paint(PaintInfo&, int tx, int ty);
-    virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
-    virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
     virtual void layout();
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, int tx, int ty, HitTestAction);
@@ -140,7 +134,6 @@ private:
     virtual HTMLElement* innerTextElement() const;
     HTMLElement* innerBlockElement() const;
     HTMLElement* innerSpinButtonElement() const;
-    HTMLElement* outerSpinButtonElement() const;
     HTMLElement* resultsButtonElement() const;
     HTMLElement* cancelButtonElement() const;
 #if ENABLE(INPUT_SPEECH)
index 46940545ae540511653a4303b6767f480c87973f..cb6e484077989621656028793f9c0d28d1d6f4f3 100644 (file)
@@ -100,7 +100,6 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
         case ListButtonPart:
         case CheckboxPart:
         case InnerSpinButtonPart:
-        case OuterSpinButtonPart:
         case RadioPart:
         case PushButtonPart:
         case SquareButtonPart:
@@ -192,8 +191,6 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
             return adjustButtonStyle(selector, style, e);
         case InnerSpinButtonPart:
             return adjustInnerSpinButtonStyle(selector, style, e);
-        case OuterSpinButtonPart:
-            return adjustOuterSpinButtonStyle(selector, style, e);
 #endif
         case TextFieldPart:
             return adjustTextFieldStyle(selector, style, e);
@@ -267,7 +264,6 @@ bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRe
         case DefaultButtonPart:
         case ButtonPart:
         case InnerSpinButtonPart:
-        case OuterSpinButtonPart:
             m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), o->view()->frameView());
             return false;
         default:
@@ -290,8 +286,6 @@ bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRe
             return paintButton(o, paintInfo, r);
         case InnerSpinButtonPart:
             return paintInnerSpinButton(o, paintInfo, r);
-        case OuterSpinButtonPart:
-            return paintOuterSpinButton(o, paintInfo, r);
 #endif
         case MenulistPart:
             return paintMenuList(o, paintInfo, r);
@@ -895,11 +889,6 @@ void RenderTheme::adjustButtonStyle(CSSStyleSelector*, RenderStyle* style, Eleme
 void RenderTheme::adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const
 {
 }
-
-void RenderTheme::adjustOuterSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const
-{
-}
-
 #endif
 
 void RenderTheme::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const
index 157ba3a5d2d8ae68fa940b728aef88cb5ae03bf8..bf4fb42d620db2fcd2eb93bb42fe8b934e28df40 100644 (file)
@@ -235,8 +235,6 @@ protected:
 
     virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
     virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
-    virtual void adjustOuterSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
-    virtual bool paintOuterSpinButton(RenderObject*, const PaintInfo&, const IntRect&) { return true; }
 #endif
 
     virtual void adjustTextFieldStyle(CSSStyleSelector*, RenderStyle*, Element*) const;
index ca4ca660a45eeb6ea5b532b3ba3cbba8fe2c791b..d0fc9eb6211e25e529e549510531761340bd8e56 100644 (file)
@@ -507,7 +507,7 @@ void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
         case ListButtonPart:
         case DefaultButtonPart:
         case ButtonPart:
-        case OuterSpinButtonPart:
+        case InnerSpinButtonPart:
             return RenderTheme::adjustRepaintRect(o, r);
         default:
             break;