Chromium Code Reviews| Index: Source/core/html/HTMLTextAreaElement.cpp |
| diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp |
| index e35f10714f33d76a99ffd5d3dd5a8a2df15f1d73..baf93e1064943227b68e5bc03dfc7202fabb7231 100644 |
| --- a/Source/core/html/HTMLTextAreaElement.cpp |
| +++ b/Source/core/html/HTMLTextAreaElement.cpp |
| @@ -45,6 +45,9 @@ |
| #include "core/html/shadow/ShadowElementNames.h" |
| #include "core/html/shadow/TextControlInnerElements.h" |
| #include "core/frame/Frame.h" |
| +#include "core/frame/FrameHost.h" |
| +#include "core/page/Chrome.h" |
| +#include "core/page/ChromeClient.h" |
| #include "core/rendering/RenderTextControlMultiLine.h" |
| #include "platform/text/PlatformLocale.h" |
| #include "wtf/StdLibExtras.h" |
| @@ -277,6 +280,9 @@ void HTMLTextAreaElement::subtreeHasChanged() |
| // When typing in a textarea, childrenChanged is not called, so we need to force the directionality check. |
| calculateAndAdjustDirectionality(); |
| + |
| + ASSERT(document().isActive()); |
| + document().frameHost()->chrome().client().didChangeValueInTextField(*this); |
| } |
| void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event) const |
| @@ -436,10 +442,14 @@ String HTMLTextAreaElement::suggestedValue() const |
| void HTMLTextAreaElement::setSuggestedValue(const String& value) |
| { |
| m_suggestedValue = value; |
| - setInnerTextValue(m_suggestedValue); |
| - updatePlaceholderVisibility(false); |
| setNeedsStyleRecalc(SubtreeStyleChange); |
| - setFormControlValueMatchesRenderer(true); |
| + if (!value.isNull()) { |
| + setInnerTextValue(m_suggestedValue); |
| + updatePlaceholderVisibility(false); |
| + } else { |
| + setInnerTextValue(m_value); |
| + updatePlaceholderVisibility(false); |
|
tkent
2014/02/06 00:05:45
nit: we can merge updatePlaceholderVisibility call
ziran.sun
2014/02/06 10:32:17
Done.
|
| + } |
| } |
| String HTMLTextAreaElement::validationMessage() const |