Changeset 63288 in webkit
- Timestamp:
- Jul 14, 2010 1:20:42 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63287 r63288 1 2010-07-14 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 <input type=number> UI: inner spin button layout 6 https://bugs.webkit.org/show_bug.cgi?id=41924 7 8 Update test expectations because a shadow node is added to 9 <input type=number>. 10 11 * platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.html 12 * platform/mac/fast/forms/input-appearance-spinbutton-expected.txt: 13 * platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt: 14 1 15 2010-07-14 Kent Tamura <tkent@chromium.org> 2 16 -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-disabled-readonly-expected.txt
r63286 r63288 10 10 RenderInline {LABEL} at (0,0) size 306x18 11 11 RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 12 RenderBlock {DIV} at (192,2) size 0x25 12 13 RenderBlock {DIV} at (196,1) size 19x27 13 14 RenderText {#text} at (222,10) size 84x18 … … 16 17 RenderInline {LABEL} at (0,0) size 314x18 17 18 RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 19 RenderBlock {DIV} at (192,2) size 0x25 18 20 RenderBlock {DIV} at (196,1) size 19x27 19 21 RenderText {#text} at (222,10) size 92x18 … … 22 24 RenderInline {LABEL} at (0,0) size 324x18 23 25 RenderTextControl {INPUT} at (2,2) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 26 RenderBlock {DIV} at (192,2) size 0x25 24 27 RenderBlock {DIV} at (196,1) size 19x27 25 28 RenderText {#text} at (222,10) size 102x18 -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-expected.txt
r58561 r63288 19 19 RenderBR {BR} at (104,14) size 0x0 20 20 RenderTextControl {INPUT} at (0,19) size 100x16 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 21 RenderBlock {DIV} at (80,2) size 0x12 21 22 RenderBlock {DIV} at (84,1) size 13x15 22 23 RenderBlock {DIV} at (1,36) size 178x36 … … 26 27 RenderBR {BR} at (106,14) size 0x0 27 28 RenderTextControl {INPUT} at (0,19) size 102x17 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 29 RenderBlock {DIV} at (82,2) size 0x13 28 30 RenderBlock {DIV} at (86,1) size 13x15 29 31 RenderBlock {DIV} at (1,72) size 178x37 … … 33 35 RenderBR {BR} at (108,14) size 0x0 34 36 RenderTextControl {INPUT} at (0,19) size 104x18 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 37 RenderBlock {DIV} at (84,2) size 0x14 35 38 RenderBlock {DIV} at (88,2) size 13x15 36 39 RenderBlock {DIV} at (1,109) size 178x46 … … 40 43 RenderBR {BR} at (133,16) size 0x0 41 44 RenderTextControl {INPUT} at (2,25) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 45 RenderBlock {DIV} at (105,2) size 0x15 42 46 RenderBlock {DIV} at (109,2) size 13x15 43 47 RenderBlock {DIV} at (1,155) size 178x50 … … 47 51 RenderBR {BR} at (135,17) size 0x0 48 52 RenderTextControl {INPUT} at (2,27) size 127x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 53 RenderBlock {DIV} at (107,2) size 0x17 49 54 RenderBlock {DIV} at (111,3) size 13x15 50 55 RenderBlock {DIV} at (1,205) size 178x52 … … 54 59 RenderBR {BR} at (156,18) size 0x0 55 60 RenderTextControl {INPUT} at (2,28) size 148x22 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 61 RenderBlock {DIV} at (126,2) size 0x18 56 62 RenderBlock {DIV} at (130,0) size 15x22 57 63 RenderBlock {DIV} at (1,257) size 178x54 … … 61 67 RenderBR {BR} at (158,19) size 0x0 62 68 RenderTextControl {INPUT} at (2,29) size 150x23 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 69 RenderBlock {DIV} at (128,2) size 0x19 63 70 RenderBlock {DIV} at (132,1) size 15x22 64 71 RenderBlock {DIV} at (1,311) size 178x56 … … 68 75 RenderBR {BR} at (178,20) size 0x0 69 76 RenderTextControl {INPUT} at (2,30) size 170x24 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 77 RenderBlock {DIV} at (148,2) size 0x20 70 78 RenderBlock {DIV} at (152,1) size 15x22 71 79 RenderTableCell {TD} at (184,2) size 253x524 [r=0 c=1 rs=1 cs=1] … … 76 84 RenderBR {BR} at (180,20) size 0x0 77 85 RenderTextControl {INPUT} at (2,30) size 172x24 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 86 RenderBlock {DIV} at (150,2) size 0x20 78 87 RenderBlock {DIV} at (154,1) size 15x22 79 88 RenderBlock {DIV} at (1,57) size 251x60 … … 83 92 RenderBR {BR} at (182,21) size 0x0 84 93 RenderTextControl {INPUT} at (2,32) size 174x26 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 94 RenderBlock {DIV} at (152,2) size 0x22 85 95 RenderBlock {DIV} at (156,2) size 15x22 86 96 RenderBlock {DIV} at (1,117) size 251x62 … … 90 100 RenderBR {BR} at (203,22) size 0x0 91 101 RenderTextControl {INPUT} at (2,33) size 195x27 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 102 RenderBlock {DIV} at (169,2) size 0x23 92 103 RenderBlock {DIV} at (173,0) size 19x27 93 104 RenderBlock {DIV} at (1,179) size 251x64 … … 97 108 RenderBR {BR} at (205,23) size 0x0 98 109 RenderTextControl {INPUT} at (2,34) size 197x28 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 110 RenderBlock {DIV} at (171,2) size 0x24 99 111 RenderBlock {DIV} at (175,1) size 19x27 100 112 RenderBlock {DIV} at (1,243) size 251x66 … … 104 116 RenderBR {BR} at (226,24) size 0x0 105 117 RenderTextControl {INPUT} at (2,35) size 218x29 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 118 RenderBlock {DIV} at (192,2) size 0x25 106 119 RenderBlock {DIV} at (196,1) size 19x27 107 120 RenderBlock {DIV} at (1,309) size 251x68 … … 111 124 RenderBR {BR} at (228,25) size 0x0 112 125 RenderTextControl {INPUT} at (2,36) size 220x30 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 126 RenderBlock {DIV} at (194,2) size 0x26 113 127 RenderBlock {DIV} at (198,2) size 19x27 114 128 RenderBlock {DIV} at (1,377) size 251x72 … … 118 132 RenderBR {BR} at (249,26) size 0x0 119 133 RenderTextControl {INPUT} at (2,38) size 241x32 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 134 RenderBlock {DIV} at (215,2) size 0x28 120 135 RenderBlock {DIV} at (219,3) size 19x27 121 136 RenderBlock {DIV} at (1,449) size 251x74 … … 125 140 RenderBR {BR} at (251,27) size 0x0 126 141 RenderTextControl {INPUT} at (2,39) size 243x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 142 RenderBlock {DIV} at (217,2) size 0x29 127 143 RenderBlock {DIV} at (221,3) size 19x27 128 144 layer at (14,129) size 94x10 -
trunk/LayoutTests/platform/mac/fast/forms/input-appearance-spinbutton-up-expected.txt
r61751 r63288 10 10 RenderBlock (anonymous) at (0,34) size 784x31 11 11 RenderTextControl {INPUT} at (2,2) size 195x27 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 12 RenderBlock {DIV} at (169,2) size 0x23 12 13 RenderBlock {DIV} at (173,0) size 19x27 13 14 RenderText {#text} at (0,0) size 0x0 -
trunk/WebCore/ChangeLog
r63286 r63288 1 2010-07-14 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 <input type=number> UI: inner spin button layout 6 https://bugs.webkit.org/show_bug.cgi?id=41924 7 8 Add layout/event/style code for the inner spin button, which is 9 going to be used for Windows implementation. 10 No new tests because no ports implement the inner spin button yet. 11 12 * rendering/RenderTextControlSingleLine.cpp: 13 Introduce m_innerSpinButton. 14 (WebCore::RenderTextControlSingleLine::~RenderTextControlSingleLine): 15 Detach m_innerSpinButton. 16 (WebCore::RenderTextControlSingleLine::layout): 17 Set position and size of m_innerSpinButton. 18 (WebCore::RenderTextControlSingleLine::nodeAtPoint): 19 Handle m_innerSpinButton. 20 (WebCore::RenderTextControlSingleLine::forwardEvent): 21 Handle m_innerSpinButton. 22 (WebCore::RenderTextControlSingleLine::textBlockWidth): 23 Shorten the text block width by m_innerSpinButton width. 24 (WebCore::RenderTextControlSingleLine::preferredContentWidth): 25 Add m_innerSpinButton width. 26 (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded): 27 Handle m_innerSpinButton. 28 (WebCore::RenderTextControlSingleLine::createInnerSpinButtonStyle): 29 Make style for m_innerSpinButton with INNER_SPIN_BUTTON pseudo class. 30 * rendering/RenderTextControlSingleLine.h: 31 1 32 2010-07-14 Kent Tamura <tkent@chromium.org> 2 33 -
trunk/WebCore/rendering/RenderTextControlSingleLine.cpp
r63179 r63288 70 70 m_innerBlock->detach(); 71 71 72 if (m_innerSpinButton) 73 m_innerSpinButton->detach(); 72 74 if (m_outerSpinButton) 73 75 m_outerSpinButton->detach(); … … 257 259 if (currentHeight < height()) 258 260 childBlock->setY((height() - currentHeight) / 2); 261 262 // Ignores the paddings for the inner spin button. 263 if (RenderBox* spinBox = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) { 264 spinBox->setLocation(spinBox->x() + paddingRight(), borderTop()); 265 spinBox->setHeight(height() - borderTop() - borderBottom()); 266 } 259 267 260 268 // Center the spin button vertically, and move it to the right by … … 289 297 290 298 // If we found a spin button, we're done. 299 if (m_innerSpinButton && result.innerNode() == m_innerSpinButton) 300 return true; 291 301 if (m_outerSpinButton && result.innerNode() == m_outerSpinButton) 292 302 return true; … … 373 383 else if (m_cancelButton && localPoint.x() > textRight) 374 384 m_cancelButton->defaultEventHandler(event); 385 else if (m_innerSpinButton && localPoint.x() > textRight && localPoint.x() < textRight + m_innerSpinButton->renderBox()->width()) 386 m_innerSpinButton->defaultEventHandler(event); 375 387 else if (m_outerSpinButton && localPoint.x() > textRight) 376 388 m_outerSpinButton->defaultEventHandler(event); … … 464 476 cancelRenderer->calcWidth(); 465 477 width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight(); 478 } 479 480 if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) { 481 spinRenderer->calcWidth(); 482 width -= spinRenderer->width() + spinRenderer->marginLeft() + spinRenderer->marginRight(); 466 483 } 467 484 … … 531 548 cancelRenderer->paddingLeft() + cancelRenderer->paddingRight(); 532 549 550 if (RenderBox* spinRenderer = m_innerSpinButton ? m_innerSpinButton->renderBox() : 0) 551 result += spinRenderer->minPrefWidth(); 552 533 553 #if ENABLE(INPUT_SPEECH) 534 554 if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) { … … 595 615 if (!createSubtree) { 596 616 RenderTextControl::createSubtreeIfNeeded(m_innerBlock.get()); 597 if (inputElement()->hasSpinButton() && !m_outerSpinButton) { 617 bool hasSpinButton = inputElement()->hasSpinButton(); 618 if (hasSpinButton && !m_innerSpinButton) { 619 m_innerSpinButton = SpinButtonElement::create(node()); 620 m_innerSpinButton->attachInnerElement(node(), createInnerSpinButtonStyle(), renderArena()); 621 } 622 if (hasSpinButton && !m_outerSpinButton) { 598 623 m_outerSpinButton = SpinButtonElement::create(node()); 599 624 m_outerSpinButton->attachInnerElement(node(), createOuterSpinButtonStyle(), renderArena()); … … 762 787 cancelBlockStyle->setVisibility(visibilityForCancelButton()); 763 788 return cancelBlockStyle.release(); 789 } 790 791 PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerSpinButtonStyle() const 792 { 793 ASSERT(node()->isHTMLElement()); 794 RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(INNER_SPIN_BUTTON); 795 if (!buttonStyle) 796 buttonStyle = RenderStyle::create(); 797 buttonStyle->inheritFrom(style()); 798 return buttonStyle.release(); 764 799 } 765 800 -
trunk/WebCore/rendering/RenderTextControlSingleLine.h
r63179 r63288 99 99 PassRefPtr<RenderStyle> createResultsButtonStyle(const RenderStyle* startStyle) const; 100 100 PassRefPtr<RenderStyle> createCancelButtonStyle(const RenderStyle* startStyle) const; 101 PassRefPtr<RenderStyle> createInnerSpinButtonStyle() const; 101 102 PassRefPtr<RenderStyle> createOuterSpinButtonStyle() const; 102 103 #if ENABLE(INPUT_SPEECH) … … 147 148 RefPtr<SearchFieldResultsButtonElement> m_resultsButton; 148 149 RefPtr<SearchFieldCancelButtonElement> m_cancelButton; 150 RefPtr<TextControlInnerElement> m_innerSpinButton; 149 151 RefPtr<TextControlInnerElement> m_outerSpinButton; 150 152 #if ENABLE(INPUT_SPEECH)
Note: See TracChangeset
for help on using the changeset viewer.