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

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: Update documentation as per tkent's review comments Created 6 years, 9 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') | no next file with comments »
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 23fee84bc5953a2e11617e291828fc5bc64c0666..210fb8f2418dbd0f1b04d3ea2847e7249719dcd0 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -40,11 +40,14 @@
#include "core/events/BeforeTextInsertedEvent.h"
#include "core/events/Event.h"
#include "core/events/ThreadLocalEventNames.h"
+#include "core/frame/FrameHost.h"
#include "core/frame/LocalFrame.h"
#include "core/html/FormDataList.h"
#include "core/html/forms/FormController.h"
#include "core/html/shadow/ShadowElementNames.h"
#include "core/html/shadow/TextControlInnerElements.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
@@ -437,10 +443,13 @@ String HTMLTextAreaElement::suggestedValue() const
void HTMLTextAreaElement::setSuggestedValue(const String& value)
{
m_suggestedValue = value;
- setInnerTextValue(m_suggestedValue);
+
+ if (!value.isNull())
+ setInnerTextValue(m_suggestedValue);
+ else
+ setInnerTextValue(m_value);
updatePlaceholderVisibility(false);
setNeedsStyleRecalc(SubtreeStyleChange);
- setFormControlValueMatchesRenderer(true);
}
String HTMLTextAreaElement::validationMessage() const
« no previous file with comments | « no previous file | Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698