Changeset 72052 in webkit
- Timestamp:
- Nov 15, 2010 6:09:43 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r72050 r72052 1 2010-11-15 Adele Peterson <adele@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Test for: https://bugs.webkit.org/show_bug.cgi?id=49452 6 Placeholder should not be swapped in and out of the text control's inner text element 7 8 The only visual change that occurred is in pseudo-cache-stale.html. The placeholder text did not 9 use to paint over the spot where the cancel button will display. Since the cancel button is not 10 present when the placeholder is drawn, now the placeholder text can draw to the edge of the field. 11 12 * platform/mac/fast/css/pseudo-cache-stale-expected.checksum: 13 * platform/mac/fast/css/pseudo-cache-stale-expected.png: 14 * platform/mac/fast/css/pseudo-cache-stale-expected.txt: 15 * platform/mac/fast/forms/isindex-placeholder-expected.txt: 16 * platform/mac/fast/forms/password-placeholder-expected.txt: 17 * platform/mac/fast/forms/password-placeholder-text-security-expected.txt: 18 * platform/mac/fast/forms/placeholder-pseudo-style-expected.txt: 19 * platform/mac/fast/forms/placeholder-set-attribute-expected.txt: 20 * platform/mac/fast/forms/placeholder-stripped-expected.txt: 21 * platform/mac/fast/forms/search-placeholder-value-changed-expected.txt: 22 * platform/mac/fast/forms/search-styled-expected.txt: 23 * platform/mac/fast/forms/textarea-placeholder-pseudo-style-expected.txt: 24 * platform/mac/fast/forms/textarea-placeholder-set-attribute-expected.txt: 25 1 26 2010-11-15 Gavin Barraclough <barraclough@apple.com> 2 27 -
trunk/LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.checksum
r59251 r72052 1 b22ad20cdd4a8b52a334434c3ae0026b 1 9366e258b90951ee374befbc02a391b3 -
trunk/LayoutTests/platform/mac/fast/css/pseudo-cache-stale-expected.txt
r63403 r72052 20 20 RenderText {#text} at (0,0) size 0x0 21 21 RenderText {#text} at (0,0) size 0x0 22 layer at (21,87) size 98x13 scrollWidth 116 23 RenderBlock {DIV} at (8,0) size 98x13 [color=#008000] 24 RenderText {#text} at (1,0) size 114x13 25 text run at (1,0) width 114: "This should be green" 22 layer at (21,87) size 98x13 23 RenderBlock {DIV} at (8,0) size 98x13 -
trunk/LayoutTests/platform/mac/fast/forms/isindex-placeholder-expected.txt
r64712 r72052 35 35 RenderBlock {HR} at (0,41) size 784x2 [border: (1px inset #000000)] 36 36 layer at (335,83) size 119x13 37 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 38 RenderText {#text} at (1,0) size 63x13 39 text run at (1,0) width 63: "placeholder" 37 RenderBlock {DIV} at (3,3) size 119x13 40 38 layer at (335,168) size 119x13 41 RenderBlock {DIV} at (3,3) size 119x13 [color=#008000] 42 RenderText {#text} at (1,0) size 63x13 43 text run at (1,0) width 63: "placeholder" 39 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/LayoutTests/platform/mac/fast/forms/password-placeholder-expected.txt
r54748 r72052 7 7 RenderText {#text} at (0,0) size 0x0 8 8 layer at (13,13) size 119x13 9 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 10 RenderText {#text} at (1,0) size 36x13 11 text run at (1,0) width 36: "foobar" 9 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/LayoutTests/platform/mac/fast/forms/password-placeholder-text-security-expected.txt
r54748 r72052 23 23 RenderBR {BR} at (719,80) size 0x0 24 24 layer at (370,31) size 119x13 25 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 26 RenderText {#text} at (1,0) size 63x13 27 text run at (1,0) width 63: "placeholder" 25 RenderBlock {DIV} at (3,3) size 119x13 28 26 layer at (420,54) size 119x13 29 27 RenderBlock {DIV} at (3,3) size 119x13 … … 31 29 text run at (1,0) width 25: "\x{2022}\x{2022}\x{2022}\x{2022}" 32 30 layer at (603,77) size 119x13 33 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 34 RenderText {#text} at (1,0) size 63x13 35 text run at (1,0) width 63: "placeholder" 31 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-pseudo-style-expected.txt
r54748 r72052 28 28 RenderText {#text} at (0,0) size 0x0 29 29 layer at (13,31) size 119x13 30 RenderBlock {DIV} at (3,3) size 119x13 [color=#640000] 31 RenderText {#text} at (1,0) size 22x13 32 text run at (1,0) width 22: "text" 30 RenderBlock {DIV} at (3,3) size 119x13 33 31 layer at (154,31) size 98x13 34 RenderBlock {DIV} at (8,0) size 98x13 [color=#640000] 35 RenderText {#text} at (1,0) size 35x13 36 text run at (1,0) width 35: "search" 32 RenderBlock {DIV} at (8,0) size 98x13 37 33 layer at (279,31) size 119x13 38 RenderBlock {DIV} at (3,3) size 119x13 [color=#640000] 39 RenderText {#text} at (1,0) size 51x13 40 text run at (1,0) width 51: "password" 34 RenderBlock {DIV} at (3,3) size 119x13 41 35 layer at (412,31) size 119x13 42 RenderBlock {DIV} at (3,3) size 119x13 [color=#B80000] 43 RenderText {#text} at (1,0) size 70x13 44 text run at (1,0) width 70: "disabled text" 36 RenderBlock {DIV} at (3,3) size 119x13 [color=#545454] 45 37 layer at (545,31) size 119x13 46 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 47 RenderText {#text} at (1,0) size 38x13 48 text run at (1,0) width 38: "default" 38 RenderBlock {DIV} at (3,3) size 119x13 49 39 layer at (13,54) size 119x13 50 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 51 RenderText {#text} at (1,0) size 86x13 52 text run at (1,0) width 86: "default disabled" 40 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-set-attribute-expected.txt
r54748 r72052 10 10 RenderTextControl {INPUT} at (2,2) size 125x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)] 11 11 layer at (13,47) size 119x13 12 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 13 RenderText {#text} at (1,0) size 62x13 14 text run at (1,0) width 62: "Placeholder" 12 RenderBlock {DIV} at (3,3) size 119x13 -
trunk/LayoutTests/platform/mac/fast/forms/placeholder-stripped-expected.txt
r63403 r72052 16 16 RenderText {#text} at (0,0) size 0x0 17 17 layer at (13,73) size 119x13 18 RenderBlock {DIV} at (3,3) size 119x13 [color=#A9A9A9] 19 RenderText {#text} at (1,0) size 109x13 20 text run at (1,0) width 109: "first line second line" 18 RenderBlock {DIV} at (3,3) size 119x13 21 19 layer at (13,96) size 119x13 22 20 RenderBlock {DIV} at (3,3) size 119x13 23 21 layer at (10,116) size 161x32 clip at (11,117) size 159x30 24 22 RenderTextControl {TEXTAREA} at (2,48) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 25 RenderBlock {DIV} at (3,3) size 155x13 [color=#A9A9A9] 26 RenderText {#text} at (0,0) size 109x13 27 text run at (0,0) width 109: "first line second line" 23 RenderBlock {DIV} at (3,3) size 155x13 28 24 layer at (10,156) size 161x32 clip at (11,157) size 159x30 29 25 RenderTextControl {TEXTAREA} at (2,88) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] -
trunk/LayoutTests/platform/mac/fast/forms/search-placeholder-value-changed-expected.txt
r54748 r72052 11 11 RenderText {#text} at (0,0) size 0x0 12 12 layer at (21,13) size 98x13 13 RenderBlock {DIV} at (8,0) size 98x13 [color=#A9A9A9] 14 RenderText {#text} at (1,0) size 63x13 15 text run at (1,0) width 63: "Test Passed" 13 RenderBlock {DIV} at (8,0) size 98x13 -
trunk/LayoutTests/platform/mac/fast/forms/search-styled-expected.txt
r63403 r72052 9 9 RenderBlock {DIV} at (106,0) size 13x11 10 10 RenderText {#text} at (0,0) size 0x0 11 layer at (35,13) size 84x13 scrollWidth 95 12 RenderBlock {DIV} at (22,0) size 84x13 [color=#A9A9A9] 13 RenderText {#text} at (1,0) size 93x13 14 text run at (1,0) width 93: "Search for Events" 11 layer at (35,13) size 84x13 12 RenderBlock {DIV} at (22,0) size 84x13 -
trunk/LayoutTests/platform/mac/fast/forms/textarea-placeholder-pseudo-style-expected.txt
r54748 r72052 16 16 layer at (10,28) size 161x32 clip at (11,29) size 159x30 17 17 RenderTextControl {TEXTAREA} at (2,20) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 18 RenderBlock {DIV} at (3,3) size 155x13 [color=#640000] 19 RenderText {#text} at (0,0) size 22x13 20 text run at (0,0) width 22: "text" 18 RenderBlock {DIV} at (3,3) size 155x13 21 19 layer at (179,28) size 161x32 clip at (180,29) size 159x30 22 20 RenderTextControl {TEXTAREA} at (171,20) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 23 RenderBlock {DIV} at (3,3) size 155x13 [color=#B80000] 24 RenderText {#text} at (0,0) size 70x13 25 text run at (0,0) width 70: "disabled text" 21 RenderBlock {DIV} at (3,3) size 155x13 [color=#545454] 26 22 layer at (348,28) size 161x32 clip at (349,29) size 159x30 27 23 RenderTextControl {TEXTAREA} at (340,20) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 28 RenderBlock {DIV} at (3,3) size 155x13 [color=#A9A9A9] 29 RenderText {#text} at (0,0) size 38x13 30 text run at (0,0) width 38: "default" 24 RenderBlock {DIV} at (3,3) size 155x13 31 25 layer at (517,28) size 161x32 clip at (518,29) size 159x30 32 26 RenderTextControl {TEXTAREA} at (509,20) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 33 RenderBlock {DIV} at (3,3) size 155x13 [color=#A9A9A9] 34 RenderText {#text} at (0,0) size 86x13 35 text run at (0,0) width 86: "default disabled" 27 RenderBlock {DIV} at (3,3) size 155x13 [color=#545454] -
trunk/LayoutTests/platform/mac/fast/forms/textarea-placeholder-set-attribute-expected.txt
r54748 r72052 10 10 layer at (10,44) size 161x32 clip at (11,45) size 159x30 11 11 RenderTextControl {TEXTAREA} at (2,2) size 161x32 [bgcolor=#FFFFFF] [border: (1px solid #000000)] 12 RenderBlock {DIV} at (3,3) size 155x13 [color=#A9A9A9] 13 RenderText {#text} at (0,0) size 62x13 14 text run at (0,0) width 62: "Placeholder" 12 RenderBlock {DIV} at (3,3) size 155x13 -
trunk/WebCore/ChangeLog
r72049 r72052 1 2010-11-15 Adele Peterson <adele@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Fix for: https://bugs.webkit.org/show_bug.cgi?id=49452 6 Placeholder should not be swapped in and out of the text control's inner text element 7 8 There's no need to swap the placeholder text in and out of the inner text element. Instead, just paint the text. 9 This reduces complexity and makes it easier to make independent decisions about the placeholder text and the text control value. 10 11 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setValueFromRenderer): 12 Since updatePlaceholderVisibility checks the value, set the value before calling updatePlaceholderVisibility. 13 * rendering/RenderTextControl.cpp: 14 (WebCore::RenderTextControl::updatePlaceholderVisibility): Remove code that set the inner text value with the placeholder text. 15 (WebCore::RenderTextControl::paintObject): Paint the placeholder text during the background phase. 16 * rendering/RenderTextControl.h: 17 * rendering/RenderTextControlMultiLine.cpp: 18 (WebCore::RenderTextControlMultiLine::nodeAtPoint): Remove custom hit testing that tried to avoid hitting the placeholder text at the wrong time. 19 (WebCore::RenderTextControlMultiLine::updateFromElement): Remove code that set the inner text value with the placeholder text. 20 (WebCore::RenderTextControlMultiLine::createInnerTextStyle): Remove code that created the inner text style based on the placeholder pseudoelement. 21 (WebCore::RenderTextControlMultiLine::textBoxInsetLeft): Added. 22 (WebCore::RenderTextControlMultiLine::textBoxInsetRight): Added. 23 * rendering/RenderTextControlMultiLine.h: 24 * rendering/RenderTextControlSingleLine.cpp: 25 (WebCore::RenderTextControlSingleLine::updateFromElement): Remove code that set the inner text value with the placeholder text. 26 (WebCore::RenderTextControlSingleLine::createInnerTextStyle): Remove code that created the inner text style based on the placeholder pseudoelement. 27 (WebCore::RenderTextControlSingleLine::textBoxInsetLeft): Added. 28 (WebCore::RenderTextControlSingleLine::textBoxInsetRight): Added. 29 * rendering/RenderTextControlSingleLine.h: 30 * rendering/TextControlInnerElements.cpp: Removed custom hit testing that tried to avoid hitting the placeholder text at the wrong time. 31 1 32 2010-11-15 Andreas Kling <kling@webkit.org> 2 33 -
trunk/WebCore/html/HTMLInputElement.cpp
r72038 r72052 1126 1126 ASSERT(deprecatedInputType() != FILE); 1127 1127 m_data.setSuggestedValue(String()); 1128 InputElement::setValueFromRenderer(m_data, this, this, value); 1128 1129 updatePlaceholderVisibility(false); 1129 InputElement::setValueFromRenderer(m_data, this, this, value);1130 1130 setNeedsValidityCheck(); 1131 1131 -
trunk/WebCore/rendering/RenderTextControl.cpp
r71880 r72052 579 579 bool oldPlaceholderVisible = m_placeholderVisible; 580 580 m_placeholderVisible = placeholderShouldBeVisible; 581 if (oldPlaceholderVisible != m_placeholderVisible || placeholderValueChanged) { 582 // Sets the inner text style to the normal style or :placeholder style. 583 setInnerTextStyle(createInnerTextStyle(textBaseStyle())); 584 585 // updateFromElement() of the subclasses updates the text content 586 // to the element's value(), placeholder(), or the empty string. 587 updateFromElement(); 588 } 581 if (oldPlaceholderVisible != m_placeholderVisible || placeholderValueChanged) 582 repaint(); 583 } 584 585 void RenderTextControl::paintPlaceholder(PaintInfo& paintInfo, int tx, int ty) 586 { 587 if (style()->visibility() != VISIBLE) 588 return; 589 590 IntRect clipRect(tx + borderLeft(), ty + borderTop(), width() - borderLeft() - borderRight(), height() - borderBottom() - borderTop()); 591 if (clipRect.isEmpty()) 592 return; 593 594 paintInfo.context->save(); 595 596 paintInfo.context->clip(clipRect); 597 598 RefPtr<RenderStyle> placeholderStyle = getCachedPseudoStyle(INPUT_PLACEHOLDER); 599 if (!placeholderStyle) 600 placeholderStyle = style(); 601 602 paintInfo.context->setFillColor(placeholderStyle->visitedDependentColor(CSSPropertyColor), placeholderStyle->colorSpace()); 603 604 String placeholderText = static_cast<HTMLTextFormControlElement*>(node())->strippedPlaceholder(); 605 TextRun textRun(placeholderText.characters(), placeholderText.length(), 0, 0, 0, !placeholderStyle->isLeftToRightDirection(), placeholderStyle->unicodeBidi() == Override, false, false); 606 607 RenderBox* textRenderer = innerTextElement() ? innerTextElement()->renderBox() : 0; 608 if (textRenderer) { 609 IntPoint textPoint; 610 textPoint.setY(ty + borderTop() + paddingTop() + textRenderer->paddingTop() + placeholderStyle->font().ascent()); 611 if (placeholderStyle->isLeftToRightDirection()) 612 textPoint.setX(tx + textBlockInsetLeft()); 613 else 614 textPoint.setX(tx + width() - textBlockInsetRight() - style()->font().width(textRun)); 615 616 paintInfo.context->drawBidiText(placeholderStyle->font(), textRun, textPoint); 617 } 618 paintInfo.context->restore(); 619 } 620 621 void RenderTextControl::paintObject(PaintInfo& paintInfo, int tx, int ty) 622 { 623 if (m_placeholderVisible && paintInfo.phase == PaintPhaseForeground) 624 paintPlaceholder(paintInfo, tx, ty); 625 626 RenderBlock::paintObject(paintInfo, tx, ty); 589 627 } 590 628 -
trunk/WebCore/rendering/RenderTextControl.h
r71880 r72052 97 97 virtual bool avoidsFloats() const { return true; } 98 98 void setInnerTextStyle(PassRefPtr<RenderStyle>); 99 virtual void paintObject(PaintInfo&, int tx, int ty); 99 100 100 101 virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty); … … 109 110 friend void setSelectionRange(Node*, int start, int end); 110 111 bool isSelectableElement(Node*) const; 112 113 virtual int textBlockInsetLeft() const = 0; 114 virtual int textBlockInsetRight() const = 0; 115 116 void paintPlaceholder(PaintInfo&, int tx, int ty); 111 117 112 118 bool m_wasChangedSinceLastChangeEvent; -
trunk/WebCore/rendering/RenderTextControlMultiLine.cpp
r71934 r72052 62 62 return false; 63 63 64 bool resultIsTextValueOrPlaceholder 65 = (!m_placeholderVisible && result.innerNode() == innerTextElement()) 66 || (m_placeholderVisible && result.innerNode()->isDescendantOf(innerTextElement())); 67 if (result.innerNode() == node() || resultIsTextValueOrPlaceholder) 64 if (result.innerNode() == node() || result.innerNode() == innerTextElement()) 68 65 hitInnerTextElement(result, x, y, tx, ty); 69 66 … … 108 105 RenderTextControl::updateFromElement(); 109 106 110 HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(node()); 111 if (m_placeholderVisible) 112 setInnerTextValue(textArea->strippedPlaceholder()); 113 else 114 setInnerTextValue(textArea->value()); 107 setInnerTextValue(static_cast<HTMLTextAreaElement*>(node())->value()); 115 108 } 116 109 … … 122 115 PassRefPtr<RenderStyle> RenderTextControlMultiLine::createInnerTextStyle(const RenderStyle* startStyle) const 123 116 { 124 RefPtr<RenderStyle> textBlockStyle; 125 if (m_placeholderVisible) { 126 if (RenderStyle* pseudoStyle = getCachedPseudoStyle(INPUT_PLACEHOLDER)) 127 textBlockStyle = RenderStyle::clone(pseudoStyle); 128 } 129 if (!textBlockStyle) { 130 textBlockStyle = RenderStyle::create(); 131 textBlockStyle->inheritFrom(startStyle); 132 } 133 117 RefPtr<RenderStyle> textBlockStyle = RenderStyle::create(); 118 textBlockStyle->inheritFrom(startStyle); 134 119 adjustInnerTextStyle(startStyle, textBlockStyle.get()); 135 120 textBlockStyle->setDisplay(BLOCK); … … 142 127 return style(); 143 128 } 129 130 int RenderTextControlMultiLine::textBlockInsetLeft() const 131 { 132 int inset = borderLeft() + paddingLeft(); 133 if (HTMLElement* innerText = innerTextElement()) { 134 if (RenderBox* innerTextRenderer = innerText->renderBox()) 135 inset += innerTextRenderer->paddingLeft(); 136 } 137 return inset; 138 } 139 140 int RenderTextControlMultiLine::textBlockInsetRight() const 141 { 142 int inset = borderRight() + paddingRight(); 143 if (HTMLElement* innerText = innerTextElement()) { 144 if (RenderBox* innerTextRenderer = innerText->renderBox()) 145 inset += innerTextRenderer->paddingRight(); 146 } 147 return inset; 148 } 144 149 145 150 } -
trunk/WebCore/rendering/RenderTextControlMultiLine.h
r70072 r72052 51 51 virtual RenderStyle* textBaseStyle() const; 52 52 virtual PassRefPtr<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const; 53 virtual int textBlockInsetLeft() const; 54 virtual int textBlockInsetRight() const; 53 55 }; 54 56 -
trunk/WebCore/rendering/RenderTextControlSingleLine.cpp
r71618 r72052 675 675 updateCancelButtonVisibility(); 676 676 677 if (m_placeholderVisible) { 678 // node() must be an HTMLInputElement. WMLInputElement doesn't support placeholder. 679 ASSERT(node()->isHTMLElement()); 680 ExceptionCode ec = 0; 681 innerTextElement()->setInnerText(static_cast<HTMLInputElement*>(node())->strippedPlaceholder(), ec); 682 ASSERT(!ec); 683 } else { 684 if (!inputElement()->suggestedValue().isNull()) 685 setInnerTextValue(inputElement()->suggestedValue()); 686 else { 687 bool shouldUpdateValue = true; 688 if (node()->isHTMLElement()) { 689 // For HTMLInputElement, update the renderer value if the element 690 // supports placeholder or the formControlValueMatchesRenderer() 691 // flag is false. It protects an unacceptable renderer value from 692 // being overwritten with the DOM value. 693 shouldUpdateValue = static_cast<HTMLTextFormControlElement*>(node())->supportsPlaceholder() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer(); 694 } 695 if (shouldUpdateValue) 677 if (!inputElement()->suggestedValue().isNull()) 678 setInnerTextValue(inputElement()->suggestedValue()); 679 else { 680 if (node()->hasTagName(inputTag)) { 681 // For HTMLInputElement, update the renderer value if the formControlValueMatchesRenderer() 682 // flag is false. It protects an unacceptable renderer value from 683 // being overwritten with the DOM value. 684 if (!static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer()) 696 685 setInnerTextValue(inputElement()->value()); 697 686 } … … 709 698 PassRefPtr<RenderStyle> RenderTextControlSingleLine::createInnerTextStyle(const RenderStyle* startStyle) const 710 699 { 711 RefPtr<RenderStyle> textBlockStyle; 712 if (m_placeholderVisible) { 713 if (RenderStyle* pseudoStyle = getCachedPseudoStyle(INPUT_PLACEHOLDER)) 714 textBlockStyle = RenderStyle::clone(pseudoStyle); 715 } 716 if (!textBlockStyle) { 717 textBlockStyle = RenderStyle::create(); 718 textBlockStyle->inheritFrom(startStyle); 719 } 720 700 RefPtr<RenderStyle> textBlockStyle = RenderStyle::create(); 701 textBlockStyle->inheritFrom(startStyle); 721 702 adjustInnerTextStyle(startStyle, textBlockStyle.get()); 722 703 … … 740 721 textBlockStyle->setPaddingLeft(Length(1, Fixed)); 741 722 textBlockStyle->setPaddingRight(Length(1, Fixed)); 742 743 // When the placeholder is going to be displayed, temporarily override the text security to be "none".744 // After this, updateFromElement will immediately update the text displayed.745 // When the placeholder is no longer visible, updatePlaceholderVisiblity will reset the style,746 // and the text security mode will be set back to the computed value correctly.747 if (m_placeholderVisible)748 textBlockStyle->setTextSecurity(TSNONE);749 723 750 724 return textBlockStyle.release(); … … 1113 1087 } 1114 1088 1115 } 1089 int RenderTextControlSingleLine::textBlockInsetLeft() const 1090 { 1091 int inset = borderLeft() + clientPaddingLeft(); 1092 if (HTMLElement* innerText = innerTextElement()) { 1093 if (RenderBox* innerTextRenderer = innerText->renderBox()) 1094 inset += innerTextRenderer->paddingLeft(); 1095 } 1096 return inset; 1097 } 1098 1099 int RenderTextControlSingleLine::textBlockInsetRight() const 1100 { 1101 int inset = borderRight() + clientPaddingRight(); 1102 if (HTMLElement* innerText = innerTextElement()) { 1103 if (RenderBox* innerTextRenderer = innerText->renderBox()) 1104 inset += innerTextRenderer->paddingRight(); 1105 } 1106 return inset; 1107 } 1108 1109 } -
trunk/WebCore/rendering/RenderTextControlSingleLine.h
r71900 r72052 144 144 InputElement* inputElement() const; 145 145 146 virtual int textBlockInsetLeft() const; 147 virtual int textBlockInsetRight() const; 148 146 149 bool m_searchPopupIsVisible; 147 150 bool m_shouldDrawCapsLockIndicator; -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r71934 r72052 52 52 53 53 private: 54 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);55 54 virtual VisiblePosition positionForPoint(const IntPoint&); 56 55 57 56 bool m_multiLine; 58 57 }; 59 60 bool RenderTextControlInnerBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)61 {62 RenderObject* renderer = node()->shadowAncestorNode()->renderer();63 64 bool placeholderIsVisible = false;65 if (renderer->isTextField())66 placeholderIsVisible = toRenderTextControlSingleLine(renderer)->placeholderIsVisible();67 68 return RenderBlock::nodeAtPoint(request, result, x, y, tx, ty, placeholderIsVisible ? HitTestBlockBackground : hitTestAction);69 }70 58 71 59 VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& point)
Note: See TracChangeset
for help on using the changeset viewer.