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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 995363002: Implement autocapitalize in Blink to be used by the embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update webexposed tests Created 5 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/core/html/forms/TextInputType.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ce985a877372b08c8a422acf7700c6d1e30563f1..adf160d92cc03de99d7e5faee6fc5f8c0d49811c 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2523,6 +2523,28 @@ int WebViewImpl::textInputFlags()
else if (spellcheck == SpellcheckAttributeFalse)
flags |= WebTextInputFlagSpellcheckOff;
+ if (isHTMLTextFormControlElement(element)) {
+ HTMLTextFormControlElement* formElement = static_cast<HTMLTextFormControlElement*>(element);
+ if (formElement->supportsAutocapitalize()) {
+ DEFINE_STATIC_LOCAL(const AtomicString, none, ("none", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, characters, ("characters", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, words, ("words", AtomicString::ConstructFromLiteral));
+ DEFINE_STATIC_LOCAL(const AtomicString, sentences, ("sentences", AtomicString::ConstructFromLiteral));
+
+ const AtomicString& autocapitalize = formElement->autocapitalize();
+ if (autocapitalize == none)
+ flags |= WebTextInputFlagAutocapitalizeNone;
+ else if (autocapitalize == characters)
+ flags |= WebTextInputFlagAutocapitalizeCharacters;
+ else if (autocapitalize == words)
+ flags |= WebTextInputFlagAutocapitalizeWords;
+ else if (autocapitalize == sentences)
+ flags |= WebTextInputFlagAutocapitalizeSentences;
+ else
+ ASSERT_NOT_REACHED();
+ }
+ }
+
return flags;
}
« no previous file with comments | « Source/core/html/forms/TextInputType.cpp ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698