Changeset 87881 in webkit
- Timestamp:
- Jun 2, 2011 12:04:05 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87872 r87881 1 2011-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 1 22 2011-06-01 Adam Barth <abarth@webkit.org> 2 23 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r87872 r87881 3876 3876 BUGCR82891 LINUX : fast/speech/input-appearance-speechbutton.html = IMAGE+TEXT PASS 3877 3877 BUGWK59208 WIN MAC : fast/speech/input-appearance-searchandspeech.html = FAIL 3878 // Need rebaseline. 3879 BUGWK61845 MAC : fast/speech/input-appearance-numberandspeech.html = FAIL 3878 3880 3879 3881 // Fails on windows - added in r86693 -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt
r83145 r87881 22 22 RenderText {#text} at (222,10) size 102x18 23 23 text run at (222,10) width 102: " Read-only state" 24 layer at (13,47) size 1 88x2325 RenderBlock {DIV} at (3,3) size 1 88x2324 layer at (13,47) size 193x23 25 RenderBlock {DIV} at (3,3) size 193x23 26 26 RenderText {#text} at (1,0) size 13x23 27 27 text run at (1,0) width 13: "0" 28 layer at (13,80) size 1 88x2329 RenderBlock {DIV} at (3,3) size 1 88x23 [color=#545454]28 layer at (13,80) size 193x23 29 RenderBlock {DIV} at (3,3) size 193x23 [color=#545454] 30 30 RenderText {#text} at (1,0) size 13x23 31 31 text run at (1,0) width 13: "0" 32 layer at (13,113) size 1 88x2333 RenderBlock {DIV} at (3,3) size 1 88x2332 layer at (13,113) size 193x23 33 RenderBlock {DIV} at (3,3) size 193x23 34 34 RenderText {#text} at (1,0) size 13x23 35 35 text run at (1,0) width 13: "0" 36 layer at (20 6,45) size 19x2737 RenderBlock (relative positioned) {DIV} at (19 6,1) size 19x2738 layer at (20 6,78) size 19x2739 RenderBlock (relative positioned) {DIV} at (19 6,1) size 19x2740 layer at (20 6,111) size 19x2741 RenderBlock (relative positioned) {DIV} at (19 6,1) size 19x2736 layer at (207,46) size 19x25 37 RenderBlock (relative positioned) {DIV} at (197,2) size 19x25 38 layer at (207,79) size 19x25 39 RenderBlock (relative positioned) {DIV} at (197,2) size 19x25 40 layer 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 112 112 layer at (14,129) size 94x10 113 113 RenderBlock {DIV} at (3,3) size 94x10 114 layer at (14,145) size 76x10115 RenderBlock {DIV} at (3,3) size 76x10114 layer at (14,145) size 81x10 115 RenderBlock {DIV} at (3,3) size 81x10 116 116 layer at (14,163) size 96x11 117 117 RenderBlock {DIV} at (3,3) size 96x11 118 layer at (14,180) size 78x11119 RenderBlock {DIV} at (3,3) size 78x11118 layer at (14,180) size 83x11 119 RenderBlock {DIV} at (3,3) size 83x11 120 120 layer at (14,198) size 98x12 121 121 RenderBlock {DIV} at (3,3) size 98x12 122 layer at (14,216) size 8 0x12123 RenderBlock {DIV} at (3,3) size 8 0x12122 layer at (14,216) size 85x12 123 RenderBlock {DIV} at (3,3) size 85x12 124 124 layer at (16,236) size 119x13 125 125 RenderBlock {DIV} at (3,3) size 119x13 126 layer at (16,259) size 10 1x13127 RenderBlock {DIV} at (3,3) size 10 1x13126 layer at (16,259) size 106x13 127 RenderBlock {DIV} at (3,3) size 106x13 128 128 layer at (16,282) size 121x15 129 129 RenderBlock {DIV} at (3,3) size 121x15 130 layer at (16,307) size 10 3x15131 RenderBlock {DIV} at (3,3) size 10 3x15130 layer at (16,307) size 108x15 131 RenderBlock {DIV} at (3,3) size 108x15 132 132 layer at (16,332) size 142x16 133 133 RenderBlock {DIV} at (3,3) size 142x16 134 layer at (16,358) size 12 2x16135 RenderBlock {DIV} at (3,3) size 12 2x16134 layer at (16,358) size 127x16 135 RenderBlock {DIV} at (3,3) size 127x16 136 136 layer at (16,384) size 144x17 137 137 RenderBlock {DIV} at (3,3) size 144x17 138 layer at (16,411) size 12 4x17139 RenderBlock {DIV} at (3,3) size 12 4x17138 layer at (16,411) size 129x17 139 RenderBlock {DIV} at (3,3) size 129x17 140 140 layer at (16,438) size 164x18 141 141 RenderBlock {DIV} at (3,3) size 164x18 142 layer at (16,466) size 14 4x18143 RenderBlock {DIV} at (3,3) size 14 4x18142 layer at (16,466) size 149x18 143 RenderBlock {DIV} at (3,3) size 149x18 144 144 layer at (198,50) size 166x18 145 145 RenderBlock {DIV} at (3,3) size 166x18 146 layer at (198,78) size 1 46x18147 RenderBlock {DIV} at (3,3) size 1 46x18146 layer at (198,78) size 151x18 147 RenderBlock {DIV} at (3,3) size 151x18 148 148 layer at (198,106) size 168x20 149 149 RenderBlock {DIV} at (3,3) size 168x20 150 layer at (198,136) size 1 48x20151 RenderBlock {DIV} at (3,3) size 1 48x20150 layer at (198,136) size 153x20 151 RenderBlock {DIV} at (3,3) size 153x20 152 152 layer at (198,166) size 189x21 153 153 RenderBlock {DIV} at (3,3) size 189x21 154 layer at (198,197) size 1 65x21155 RenderBlock {DIV} at (3,3) size 1 65x21154 layer at (198,197) size 170x21 155 RenderBlock {DIV} at (3,3) size 170x21 156 156 layer at (198,228) size 191x22 157 157 RenderBlock {DIV} at (3,3) size 191x22 158 layer at (198,260) size 1 67x22159 RenderBlock {DIV} at (3,3) size 1 67x22158 layer at (198,260) size 172x22 159 RenderBlock {DIV} at (3,3) size 172x22 160 160 layer at (198,292) size 212x23 161 161 RenderBlock {DIV} at (3,3) size 212x23 162 layer at (198,325) size 1 88x23163 RenderBlock {DIV} at (3,3) size 1 88x23162 layer at (198,325) size 193x23 163 RenderBlock {DIV} at (3,3) size 193x23 164 164 layer at (198,358) size 214x24 165 165 RenderBlock {DIV} at (3,3) size 214x24 166 layer at (198,392) size 19 0x24167 RenderBlock {DIV} at (3,3) size 19 0x24166 layer at (198,392) size 195x24 167 RenderBlock {DIV} at (3,3) size 195x24 168 168 layer at (198,426) size 235x26 169 169 RenderBlock {DIV} at (3,3) size 235x26 170 layer at (198,462) size 21 1x26171 RenderBlock {DIV} at (3,3) size 21 1x26170 layer at (198,462) size 216x26 171 RenderBlock {DIV} at (3,3) size 216x26 172 172 layer at (198,498) size 237x27 173 173 RenderBlock {DIV} at (3,3) size 237x27 174 layer at (198,535) size 21 3x27175 RenderBlock {DIV} at (3,3) size 21 3x27176 layer at (9 5,143) size 13x15177 RenderBlock (relative positioned) {DIV} at (8 4,1) size 13x15178 layer at (9 7,178) size 13x15179 RenderBlock (relative positioned) {DIV} at (8 6,1) size 13x15180 layer at ( 99,215) size 13x15181 RenderBlock (relative positioned) {DIV} at (8 8,2) size 13x15182 layer at (12 2,258) size 13x15183 RenderBlock (relative positioned) {DIV} at (1 09,2) size 13x15184 layer at (12 4,307) size 13x15185 RenderBlock (relative positioned) {DIV} at (11 1,3) size 13x15186 layer at (14 3,355) size 15x22187 RenderBlock (relative positioned) {DIV} at (13 0,0) size 15x22188 layer at (14 5,409) size 15x22189 RenderBlock (relative positioned) {DIV} at (13 2,1) size 15x22190 layer at (16 5,464) size 15x22191 RenderBlock (relative positioned) {DIV} at (15 2,1) size 15x22192 layer at (3 49,76) size 15x22193 RenderBlock (relative positioned) {DIV} at (15 4,1) size 15x22194 layer at (35 1,135) size 15x22195 RenderBlock (relative positioned) {DIV} at (15 6,2) size 15x22196 layer at (36 8,194) size 19x27197 RenderBlock (relative positioned) {DIV} at (17 3,0) size 19x27198 layer at (37 0,258) size 19x27199 RenderBlock (relative positioned) {DIV} at (17 5,1) size 19x27200 layer at (39 1,323) size 19x27201 RenderBlock (relative positioned) {DIV} at (19 6,1) size 19x27202 layer at (39 3,391) size 19x27203 RenderBlock (relative positioned) {DIV} at (19 8,2) size 19x27204 layer at (41 4,462) size 19x27205 RenderBlock (relative positioned) {DIV} at (2 19,3) size 19x27206 layer at (41 6,535) size 19x27207 RenderBlock (relative positioned) {DIV} at (22 1,3) size 19x27174 layer at (198,535) size 218x27 175 RenderBlock {DIV} at (3,3) size 218x27 176 layer at (96,144) size 13x12 177 RenderBlock (relative positioned) {DIV} at (85,2) size 13x12 178 layer at (98,179) size 13x13 179 RenderBlock (relative positioned) {DIV} at (87,2) size 13x13 180 layer at (100,215) size 13x14 181 RenderBlock (relative positioned) {DIV} at (89,2) size 13x14 182 layer at (123,258) size 13x15 183 RenderBlock (relative positioned) {DIV} at (110,2) size 13x15 184 layer at (125,306) size 13x17 185 RenderBlock (relative positioned) {DIV} at (112,2) size 13x17 186 layer at (144,357) size 15x18 187 RenderBlock (relative positioned) {DIV} at (131,2) size 15x18 188 layer at (146,410) size 15x19 189 RenderBlock (relative positioned) {DIV} at (133,2) size 15x19 190 layer at (166,465) size 15x20 191 RenderBlock (relative positioned) {DIV} at (153,2) size 15x20 192 layer at (350,77) size 15x20 193 RenderBlock (relative positioned) {DIV} at (155,2) size 15x20 194 layer at (352,135) size 15x22 195 RenderBlock (relative positioned) {DIV} at (157,2) size 15x22 196 layer at (369,196) size 19x23 197 RenderBlock (relative positioned) {DIV} at (174,2) size 19x23 198 layer at (371,259) size 19x24 199 RenderBlock (relative positioned) {DIV} at (176,2) size 19x24 200 layer at (392,324) size 19x25 201 RenderBlock (relative positioned) {DIV} at (197,2) size 19x25 202 layer at (394,391) size 19x26 203 RenderBlock (relative positioned) {DIV} at (199,2) size 19x26 204 layer at (415,461) size 19x28 205 RenderBlock (relative positioned) {DIV} at (220,2) size 19x28 206 layer 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 7 7 RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 8 8 RenderText {#text} at (0,0) size 0x0 9 layer at (13,36) size 10 1x1310 RenderBlock {DIV} at (3,3) size 10 1x139 layer at (13,36) size 106x13 10 RenderBlock {DIV} at (3,3) size 106x13 11 11 RenderText {#text} at (1,0) size 14x13 12 12 text run at (1,0) width 14: "10" 13 13 layer at (10,10) size 125x19 14 14 RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 15 layer at (13,13) size 10 1x1316 RenderBlock {DIV} at (3,3) size 10 1x1315 layer at (13,13) size 106x13 16 RenderBlock {DIV} at (3,3) size 106x13 17 17 RenderText {#text} at (1,0) size 14x13 18 18 text run at (1,0) width 14: "10" 19 layer at (1 19,12) size 13x1520 RenderBlock (relative positioned) {DIV} at (1 09,2) size 13x1521 layer at (1 19,35) size 13x1522 RenderBlock (relative positioned) {DIV} at (1 09,2) size 13x1519 layer at (120,12) size 13x15 20 RenderBlock (relative positioned) {DIV} at (110,2) size 13x15 21 layer 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 12 12 RenderText {#text} at (0,0) size 0x0 13 13 RenderText {#text} at (0,0) size 0x0 14 layer at (13,47) size 1 65x2115 RenderBlock {DIV} at (3,3) size 1 65x2114 layer at (13,47) size 170x21 15 RenderBlock {DIV} at (3,3) size 170x21 16 16 RenderText {#text} at (1,0) size 12x21 17 17 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 18 layer at (184,46) size 19x23 19 RenderBlock (relative positioned) {DIV} at (174,2) size 19x23 22 20 caret: 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 9 9 RenderTextControl {INPUT} at (135,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 10 10 RenderText {#text} at (0,0) size 0x0 11 layer at (13,13) size 10 1x1312 RenderBlock {DIV} at (3,3) size 10 1x1313 layer at (146,13) size 10 1x1314 RenderBlock {DIV} at (3,3) size 10 1x1315 layer at (1 19,12) size 13x1516 RenderBlock (relative positioned) {DIV} at (1 09,2) size 13x1511 layer at (13,13) size 106x13 12 RenderBlock {DIV} at (3,3) size 106x13 13 layer at (146,13) size 106x13 14 RenderBlock {DIV} at (3,3) size 106x13 15 layer at (120,12) size 13x15 16 RenderBlock (relative positioned) {DIV} at (110,2) size 13x15 -
trunk/Source/WebCore/ChangeLog
r87880 r87881 1 2011-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 1 63 2011-06-01 Emil A Eklund <eae@chromium.org> 2 64 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r87121 r87881 302 302 m_value.ident = CSSValueRatingLevelIndicator; 303 303 break; 304 case OuterSpinButtonPart:305 m_value.ident = CSSValueOuterSpinButton;306 break;307 304 case ProgressBarPart: 308 305 #if ENABLE(PROGRESS_TAG) -
trunk/Source/WebCore/css/CSSValueKeywords.in
r87121 r87881 600 600 menulist-textfield 601 601 meter 602 outer-spin-button603 602 progress-bar 604 603 progress-bar-value -
trunk/Source/WebCore/css/html.css
r87372 r87881 455 455 } 456 456 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 467 457 #if defined(ENABLE_INPUT_SPEECH) && ENABLE_INPUT_SPEECH 468 458 input::-webkit-input-speech-button { -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r87371 r87881 142 142 { 143 143 return m_inputType->innerSpinButtonElement(); 144 }145 146 HTMLElement* HTMLInputElement::outerSpinButtonElement() const147 {148 return m_inputType->outerSpinButtonElement();149 144 } 150 145 -
trunk/Source/WebCore/html/HTMLInputElement.h
r87371 r87881 112 112 HTMLElement* innerBlockElement() const; 113 113 HTMLElement* innerSpinButtonElement() const; 114 HTMLElement* outerSpinButtonElement() const;115 114 HTMLElement* resultsButtonElement() const; 116 115 HTMLElement* cancelButtonElement() const; -
trunk/Source/WebCore/html/InputType.h
r87371 r87881 192 192 virtual HTMLElement* innerTextElement() const { return 0; } 193 193 virtual HTMLElement* innerSpinButtonElement() const { return 0; } 194 virtual HTMLElement* outerSpinButtonElement() const { return 0; }195 194 virtual HTMLElement* resultsButtonElement() const { return 0; } 196 195 virtual HTMLElement* cancelButtonElement() const { return 0; } -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r87067 r87881 52 52 , m_innerText(0) 53 53 , m_innerSpinButton(0) 54 , m_outerSpinButton(0)55 54 #if ENABLE(INPUT_SPEECH) 56 55 , m_speechButton(0) … … 135 134 ASSERT(!m_innerText); 136 135 ASSERT(!m_innerSpinButton); 137 ASSERT(!m_outerSpinButton);138 136 139 137 bool shouldHaveSpinButton = RenderTheme::themeForPage(element()->document()->page())->shouldHaveSpinButton(element()); … … 162 160 163 161 if (shouldHaveSpinButton) { 164 RefPtr<HTMLElement> inner = SpinButtonElement::createInner(document); 165 RefPtr<HTMLElement> outer = SpinButtonElement::createOuter(document); 162 RefPtr<HTMLElement> inner = SpinButtonElement::create(document); 166 163 m_innerSpinButton = inner.get(); 167 m_outerSpinButton = outer.get();168 164 element()->ensureShadowRoot()->appendChild(inner.release(), ec); 169 element()->ensureShadowRoot()->appendChild(outer.release(), ec);170 165 } 171 166 } … … 179 174 #endif 180 175 m_innerSpinButton = 0; 181 m_outerSpinButton = 0;182 176 } 183 177 -
trunk/Source/WebCore/html/TextFieldInputType.h
r87067 r87881 48 48 virtual HTMLElement* innerTextElement() const { return m_innerText; } 49 49 virtual HTMLElement* innerSpinButtonElement() const { return m_innerSpinButton; } 50 virtual HTMLElement* outerSpinButtonElement() const { return m_outerSpinButton; }51 50 #if ENABLE(INPUT_SPEECH) 52 51 virtual HTMLElement* speechButtonElement() const { return m_speechButton; } … … 74 73 HTMLElement* m_innerText; 75 74 HTMLElement* m_innerSpinButton; 76 HTMLElement* m_outerSpinButton;77 75 #if ENABLE(INPUT_SPEECH) 78 76 HTMLElement* m_speechButton; -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r87235 r87881 224 224 // ---------------------------- 225 225 226 inline SpinButtonElement::SpinButtonElement(Document* document , bool isInner)226 inline SpinButtonElement::SpinButtonElement(Document* document) 227 227 : HTMLDivElement(divTag, document) 228 , m_isInner(isInner)229 228 , m_capturing(false) 230 229 , m_upDownState(Indeterminate) … … 234 233 } 235 234 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)); 235 PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document* document) 236 { 237 return adoptRef(new SpinButtonElement(document)); 244 238 } 245 239 … … 247 241 { 248 242 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; 251 244 } 252 245 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.h
r87235 r87881 97 97 }; 98 98 99 static PassRefPtr<SpinButtonElement> createInner(Document*); 100 static PassRefPtr<SpinButtonElement> createOuter(Document*); 99 static PassRefPtr<SpinButtonElement> create(Document*); 101 100 UpDownState upDownState() const { return m_upDownState; } 102 101 103 102 private: 104 SpinButtonElement(Document* , bool isInner);103 SpinButtonElement(Document*); 105 104 106 105 virtual const AtomicString& shadowPseudoId() const; … … 116 115 virtual bool isMouseFocusable() const { return false; } 117 116 118 bool m_isInner;119 117 bool m_capturing; 120 118 UpDownState m_upDownState; -
trunk/Source/WebCore/platform/ThemeTypes.h
r74099 r87881 53 53 MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart, 54 54 MediaVolumeSliderMuteButtonPart, MediaControlsBackgroundPart, MediaControlsFullscreenBackgroundPart, MediaCurrentTimePart, MediaTimeRemainingPart, 55 MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, OuterSpinButtonPart,ProgressBarPart, ProgressBarValuePart,55 MenulistPart, MenulistButtonPart, MenulistTextPart, MenulistTextFieldPart, MeterPart, ProgressBarPart, ProgressBarValuePart, 56 56 SliderHorizontalPart, SliderVerticalPart, SliderThumbHorizontalPart, 57 57 SliderThumbVerticalPart, CaretPart, SearchFieldPart, SearchFieldDecorationPart, -
trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm
r87821 r87881 651 651 } 652 652 CGRect bounds(rect); 653 // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.654 653 CGRect backgroundBounds; 655 654 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 } 660 661 #if USE(SKIA) 661 662 gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas()); … … 664 665 CGContextRef cgContext = context->platformContext(); 665 666 #endif 667 HIThemeDrawButton(&backgroundBounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0); 666 668 HIThemeDrawButton(&bounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0); 667 669 context->restore(); … … 711 713 #endif 712 714 case InnerSpinButtonPart: 713 // We don't use inner spin buttons on Mac.714 return LengthSize(Length(Fixed), Length(Fixed));715 case OuterSpinButtonPart:716 715 if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto()) 717 716 return zoomedSize; … … 730 729 case ListButtonPart: 731 730 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: { 736 732 IntSize base = stepperSizes()[NSMiniControlSize]; 737 733 return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed), … … 814 810 break; 815 811 } 816 case OuterSpinButtonPart: {812 case InnerSpinButtonPart: { 817 813 static const int stepperMargin[4] = { 0, 0, 0, 0 }; 818 814 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor); … … 845 841 paintButton(part, states, context, zoomedRect, zoomFactor, scrollView); 846 842 break; 847 case OuterSpinButtonPart:843 case InnerSpinButtonPart: 848 844 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); 849 845 break; -
trunk/Source/WebCore/platform/mac/ThemeMac.mm
r84504 r87881 538 538 } 539 539 CGRect bounds(rect); 540 // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.541 540 CGRect backgroundBounds; 542 541 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); 548 549 } 549 550 … … 604 605 #endif 605 606 case InnerSpinButtonPart: 606 // We don't use inner spin buttons on Mac.607 return LengthSize(Length(Fixed), Length(Fixed));608 case OuterSpinButtonPart:609 607 if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto()) 610 608 return zoomedSize; … … 623 621 case ListButtonPart: 624 622 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:{ 629 624 IntSize base = stepperSizes()[NSMiniControlSize]; 630 625 return LengthSize(Length(static_cast<int>(base.width() * zoomFactor), Fixed), … … 707 702 break; 708 703 } 709 case OuterSpinButtonPart: {704 case InnerSpinButtonPart: { 710 705 static const int stepperMargin[4] = { 0, 0, 0, 0 }; 711 706 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor); … … 738 733 paintButton(part, states, context, zoomedRect, zoomFactor, scrollView); 739 734 break; 740 case OuterSpinButtonPart:735 case InnerSpinButtonPart: 741 736 paintStepper(states, context, zoomedRect, zoomFactor, scrollView); 742 737 break; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r87866 r87881 803 803 } 804 804 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 811 805 BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const 812 806 { … … 832 826 } 833 827 834 void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, IntRect paintRect) 835 { 828 void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty) 829 { 830 if (!paintInfo.shouldPaintWithinRoot(this)) 831 return; 832 IntRect paintRect(tx, ty, width(), height()); 833 836 834 // border-fit can adjust where we paint our border and background. If set, we snugly fit our line box descendants. (The iChat 837 835 // balloon layout is an example of this). -
trunk/Source/WebCore/rendering/RenderBox.h
r87866 r87881 418 418 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0); 419 419 420 void paintBoxDecorationsWithSize(PaintInfo&, IntRect);421 420 void paintMaskImages(const PaintInfo&, const IntRect&); 422 421 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r87443 r87881 104 104 } 105 105 106 inline HTMLElement* RenderTextControlSingleLine::outerSpinButtonElement() const107 {108 return inputElement()->outerSpinButtonElement();109 }110 111 106 inline HTMLElement* RenderTextControlSingleLine::resultsButtonElement() const 112 107 { … … 257 252 } 258 253 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 271 254 void RenderTextControlSingleLine::layout() 272 255 { … … 333 316 } else { 334 317 int x = width() - borderRight() - paddingRight() - button->width(); 335 if (outerSpinButtonElement() && outerSpinButtonElement()->renderBox())336 x -= outerSpinButtonElement()->renderBox()->width();337 338 318 RenderBox* spinBox = innerSpinButtonElement() ? innerSpinButtonElement()->renderBox() : 0; 339 319 if (style()->isLeftToRightDirection()) … … 346 326 } 347 327 #endif 348 349 // Center the spin button vertically, and move it to the right by350 // 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 the355 // remaining one pixel. It's good for Mac NSStepper because it has356 // 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 }361 328 } 362 329 … … 381 348 HTMLElement* innerSpinButton = innerSpinButtonElement(); 382 349 if (innerSpinButton && result.innerNode() == innerSpinButton) 383 return true;384 HTMLElement* outerSpinButton = outerSpinButtonElement();385 if (outerSpinButton && result.innerNode() == outerSpinButton)386 350 return true; 387 351 #if ENABLE(INPUT_SPEECH) … … 559 523 #endif 560 524 561 return width - decorationWidthRight();562 }563 564 int RenderTextControlSingleLine::decorationWidthRight() const565 {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();574 525 return width; 575 526 } 576 527 577 528 float RenderTextControlSingleLine::getAvgCharWidth(AtomicString family) 578 529 { … … 628 579 #endif 629 580 return result; 630 }631 632 int RenderTextControlSingleLine::preferredDecorationWidthRight() const633 {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;643 581 } 644 582 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r87443 r87881 56 56 void capsLockStateMayHaveChanged(); 57 57 58 // Decoration width outside of the text field.59 int decorationWidthRight() const;60 61 58 private: 62 int preferredDecorationWidthRight() const;63 59 virtual bool hasControlClip() const; 64 60 virtual IntRect controlClipRect(const IntPoint&) const; … … 67 63 virtual void subtreeHasChanged(); 68 64 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&);71 65 virtual void layout(); 72 66 … … 141 135 HTMLElement* innerBlockElement() const; 142 136 HTMLElement* innerSpinButtonElement() const; 143 HTMLElement* outerSpinButtonElement() const;144 137 HTMLElement* resultsButtonElement() const; 145 138 HTMLElement* cancelButtonElement() const; -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r85998 r87881 101 101 case CheckboxPart: 102 102 case InnerSpinButtonPart: 103 case OuterSpinButtonPart:104 103 case RadioPart: 105 104 case PushButtonPart: … … 193 192 case InnerSpinButtonPart: 194 193 return adjustInnerSpinButtonStyle(selector, style, e); 195 case OuterSpinButtonPart:196 return adjustOuterSpinButtonStyle(selector, style, e);197 194 #endif 198 195 case TextFieldPart: … … 268 265 case ButtonPart: 269 266 case InnerSpinButtonPart: 270 case OuterSpinButtonPart:271 267 m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), o->view()->frameView()); 272 268 return false; … … 291 287 case InnerSpinButtonPart: 292 288 return paintInnerSpinButton(o, paintInfo, r); 293 case OuterSpinButtonPart:294 return paintOuterSpinButton(o, paintInfo, r);295 289 #endif 296 290 case MenulistPart: … … 896 890 { 897 891 } 898 899 void RenderTheme::adjustOuterSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const900 {901 }902 903 892 #endif 904 893 -
trunk/Source/WebCore/rendering/RenderTheme.h
r85998 r87881 236 236 virtual void adjustInnerSpinButtonStyle(CSSStyleSelector*, RenderStyle*, Element*) const; 237 237 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; }240 238 #endif 241 239 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r86274 r87881 508 508 case DefaultButtonPart: 509 509 case ButtonPart: 510 case OuterSpinButtonPart:510 case InnerSpinButtonPart: 511 511 return RenderTheme::adjustRepaintRect(o, r); 512 512 default:
Note: See TracChangeset
for help on using the changeset viewer.