Chromium Code Reviews| Index: Source/core/html/HTMLTextAreaElement.cpp |
| diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp |
| index ae4aa22442000f1de019f3b142435cefb8b923b7..3441312a86a368e49c1f3a26ea6d717ed23359ba 100644 |
| --- a/Source/core/html/HTMLTextAreaElement.cpp |
| +++ b/Source/core/html/HTMLTextAreaElement.cpp |
| @@ -274,7 +274,7 @@ void HTMLTextAreaElement::subtreeHasChanged() |
| m_valueIsUpToDate = false; |
| setNeedsValidityCheck(); |
| setAutofilled(false); |
| - updatePlaceholderVisibility(false); |
| + updatePlaceholderVisibility(); |
| if (!focused()) |
| return; |
| @@ -332,7 +332,7 @@ void HTMLTextAreaElement::updateValue() const |
| const_cast<HTMLTextAreaElement*>(this)->m_valueIsUpToDate = true; |
| const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged(); |
| m_isDirty = true; |
| - const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility(false); |
| + const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility(); |
| } |
| String HTMLTextAreaElement::value() const |
| @@ -384,7 +384,7 @@ void HTMLTextAreaElement::setValueCommon(const String& newValue, TextFieldEventB |
| setInnerEditorValue(m_value); |
| if (eventBehavior == DispatchNoEvent) |
| setLastChangeWasNotUserEdit(); |
| - updatePlaceholderVisibility(false); |
| + updatePlaceholderVisibility(); |
| setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue)); |
| m_suggestedValue = String(); |
| setNeedsValidityCheck(); |
| @@ -499,7 +499,7 @@ void HTMLTextAreaElement::setSuggestedValue(const String& value) |
| setInnerEditorValue(m_suggestedValue); |
| else |
| setInnerEditorValue(m_value); |
| - updatePlaceholderVisibility(false); |
| + updatePlaceholderVisibility(); |
| setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue)); |
| } |
| @@ -618,6 +618,7 @@ void HTMLTextAreaElement::updatePlaceholderText() |
| placeholder = newElement.get(); |
| placeholder->setShadowPseudoId(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral)); |
| placeholder->setAttribute(idAttr, ShadowElementNames::placeholder()); |
| + placeholder->setInlineStyleProperty(CSSPropertyDisplay, isPlaceholderVisible() ? CSSValueBlock : CSSValueNone, true); |
|
esprehn
2015/08/21 10:18:10
Just call updatePlaceholderVisibility() here, no r
ramya.v
2015/08/25 10:24:45
updatePlaceholderText is called from inside update
|
| userAgentShadowRoot()->insertBefore(placeholder, innerEditorElement()->nextSibling()); |
| } |
| placeholder->setTextContent(placeholderText); |