Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: Source/core/html/HTMLTextAreaElement.cpp

Issue 133443011: Add text field change handling for autofill preview in textarea element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/page/ChromeClient.h » ('j') | Source/web/ChromeClientImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | Source/core/page/ChromeClient.h » ('j') | Source/web/ChromeClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698