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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2516 flags |= WebTextInputFlagAutocorrectOn; 2516 flags |= WebTextInputFlagAutocorrectOn;
2517 else if (autocorrect == "off") 2517 else if (autocorrect == "off")
2518 flags |= WebTextInputFlagAutocorrectOff; 2518 flags |= WebTextInputFlagAutocorrectOff;
2519 2519
2520 SpellcheckAttributeState spellcheck = element->spellcheckAttributeState(); 2520 SpellcheckAttributeState spellcheck = element->spellcheckAttributeState();
2521 if (spellcheck == SpellcheckAttributeTrue) 2521 if (spellcheck == SpellcheckAttributeTrue)
2522 flags |= WebTextInputFlagSpellcheckOn; 2522 flags |= WebTextInputFlagSpellcheckOn;
2523 else if (spellcheck == SpellcheckAttributeFalse) 2523 else if (spellcheck == SpellcheckAttributeFalse)
2524 flags |= WebTextInputFlagSpellcheckOff; 2524 flags |= WebTextInputFlagSpellcheckOff;
2525 2525
2526 if (isHTMLTextFormControlElement(element)) {
2527 HTMLTextFormControlElement* formElement = static_cast<HTMLTextFormContro lElement*>(element);
2528 if (formElement->supportsAutocapitalize()) {
2529 DEFINE_STATIC_LOCAL(const AtomicString, none, ("none", AtomicString: :ConstructFromLiteral));
2530 DEFINE_STATIC_LOCAL(const AtomicString, characters, ("characters", A tomicString::ConstructFromLiteral));
2531 DEFINE_STATIC_LOCAL(const AtomicString, words, ("words", AtomicStrin g::ConstructFromLiteral));
2532 DEFINE_STATIC_LOCAL(const AtomicString, sentences, ("sentences", Ato micString::ConstructFromLiteral));
2533
2534 const AtomicString& autocapitalize = formElement->autocapitalize();
2535 if (autocapitalize == none)
2536 flags |= WebTextInputFlagAutocapitalizeNone;
2537 else if (autocapitalize == characters)
2538 flags |= WebTextInputFlagAutocapitalizeCharacters;
2539 else if (autocapitalize == words)
2540 flags |= WebTextInputFlagAutocapitalizeWords;
2541 else if (autocapitalize == sentences)
2542 flags |= WebTextInputFlagAutocapitalizeSentences;
2543 else
2544 ASSERT_NOT_REACHED();
2545 }
2546 }
2547
2526 return flags; 2548 return flags;
2527 } 2549 }
2528 2550
2529 WebString WebViewImpl::inputModeOfFocusedElement() 2551 WebString WebViewImpl::inputModeOfFocusedElement()
2530 { 2552 {
2531 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled()) 2553 if (!RuntimeEnabledFeatures::inputModeAttributeEnabled())
2532 return WebString(); 2554 return WebString();
2533 2555
2534 Element* element = focusedElement(); 2556 Element* element = focusedElement();
2535 if (!element) 2557 if (!element)
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after
4679 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4701 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4680 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4702 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4681 } 4703 }
4682 4704
4683 void WebViewImpl::forceNextWebGLContextCreationToFail() 4705 void WebViewImpl::forceNextWebGLContextCreationToFail()
4684 { 4706 {
4685 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4707 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4686 } 4708 }
4687 4709
4688 } // namespace blink 4710 } // namespace blink
OLDNEW
« 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