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

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: ready for review 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
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ce985a877372b08c8a422acf7700c6d1e30563f1..71b61d4994ee4c3d9eb49f09557706528af27b75 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2523,6 +2523,29 @@ int WebViewImpl::textInputFlags()
else if (spellcheck == SpellcheckAttributeFalse)
flags |= WebTextInputFlagSpellcheckOff;
+ if (isHTMLTextFormControlElement(element)) {
+ HTMLTextFormControlElement* formElement = static_cast<HTMLTextFormControlElement*>(element);
+ if (formElement->supportsAutocapitalize()) {
+ switch (formElement->autocapitalizeValue()) {
+ case TextFieldAutocapitalize::None:
+ flags |= WebTextInputFlagAutocapitalizeNone;
+ break;
+ case TextFieldAutocapitalize::Characters:
+ flags |= WebTextInputFlagAutocapitalizeCharacters;
+ break;
+ case TextFieldAutocapitalize::Words:
+ flags |= WebTextInputFlagAutocapitalizeWords;
+ break;
+ case TextFieldAutocapitalize::Sentences:
+ flags |= WebTextInputFlagAutocapitalizeSentences;
+ break;
+ case TextFieldAutocapitalize::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+ }
+
return flags;
}

Powered by Google App Engine
This is Rietveld 408576698