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

Unified Diff: Source/web/WebFormControlElement.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 | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/WebInputElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFormControlElement.cpp
diff --git a/Source/web/WebFormControlElement.cpp b/Source/web/WebFormControlElement.cpp
index d833087906325288ae0a1ca59221e875b3841718..527db7713b3a61050cd5921cfee3971103d6ec93 100644
--- a/Source/web/WebFormControlElement.cpp
+++ b/Source/web/WebFormControlElement.cpp
@@ -33,6 +33,9 @@
#include "core/html/HTMLFormControlElement.h"
#include "core/html/HTMLFormElement.h"
+#include "core/html/HTMLInputElement.h"
+#include "core/html/HTMLTextAreaElement.h"
+
#include "wtf/PassRefPtr.h"
using namespace WebCore;
@@ -79,6 +82,33 @@ WebString WebFormControlElement::nameForAutofill() const
return constUnwrap<HTMLFormControlElement>()->nameForAutofill();
}
+WebString WebFormControlElement::editingValue() const
+{
+ if (m_private->hasTagName(HTMLNames::inputTag))
+ return constUnwrap<HTMLInputElement>()->innerTextValue();
+ if (m_private->hasTagName(HTMLNames::textareaTag))
+ return constUnwrap<HTMLTextAreaElement>()->innerTextValue();
+ return WebString();
+}
+
+int WebFormControlElement::selectionStart() const
+{
+ if (m_private->hasTagName(HTMLNames::inputTag))
+ return constUnwrap<HTMLInputElement>()->selectionStart();
+ if (m_private->hasTagName(HTMLNames::textareaTag))
+ return constUnwrap<HTMLTextAreaElement>()->selectionStart();
+ return 0;
+}
+
+int WebFormControlElement::selectionEnd() const
+{
+ if (m_private->hasTagName(HTMLNames::inputTag))
+ return constUnwrap<HTMLInputElement>()->selectionEnd();
+ if (m_private->hasTagName(HTMLNames::textareaTag))
+ return constUnwrap<HTMLTextAreaElement>()->selectionEnd();
+ return 0;
+}
+
WebFormElement WebFormControlElement::form() const
{
return WebFormElement(constUnwrap<HTMLFormControlElement>()->form());
« no previous file with comments | « Source/web/ChromeClientImpl.cpp ('k') | Source/web/WebInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698