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

Unified Diff: chrome/renderer/form_manager.cc

Issue 5137004: Autofill: Prefer maxLength to size attribute for form filling heuristics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 | chrome/renderer/form_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/form_manager.cc
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc
index 9855a09b35234eca5a3ea14aad4981ed021ac7b8..f1d2b2c99175cd693c39da6c8d47e8d77827e66c 100644
--- a/chrome/renderer/form_manager.cc
+++ b/chrome/renderer/form_manager.cc
@@ -310,7 +310,12 @@ void FormManager::WebFormControlElementToFormField(
if (element.formControlType() == WebString::fromUTF8("text")) {
const WebInputElement& input_element = element.toConst<WebInputElement>();
- field->set_size(input_element.size());
+ // TODO(isherman): Add "524288" as a named constant to the WebKit API
dhollowa 2010/11/18 18:26:51 It looks to me like the use of |size| was misguide
Ilya Sherman 2010/11/19 02:33:44 Done.
+ if (input_element.hasAttribute(WebString::fromUTF8("maxLength")) &&
+ input_element.maxLength() != 524288)
+ field->set_size(input_element.maxLength());
+ else
+ field->set_size(input_element.size());
}
if (!(extract_mask & EXTRACT_VALUE))
« no previous file with comments | « no previous file | chrome/renderer/form_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698