diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 23:58:43 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 23:58:43 +0000 |
commit | 06e780c4f6bead69d7a3e887e8796b7ffb701a2d (patch) | |
tree | ac8cf4e8d666013c9d5e1445c2b84b6f4918bbb0 | |
parent | 593effc33f21d429df3dc81acb7a776f05d943b1 (diff) | |
download | chromium_src-06e780c4f6bead69d7a3e887e8796b7ffb701a2d.zip chromium_src-06e780c4f6bead69d7a3e887e8796b7ffb701a2d.tar.gz chromium_src-06e780c4f6bead69d7a3e887e8796b7ffb701a2d.tar.bz2 |
Autofill filling on HTML form fills all entries except the entry clicked
Adds a call to |setSuggestedValue| in FormManager::FillFormField(). This is a work-around to a regression caused by WebKit r67122. Once the core issue is fixed in WebKit, this work-around should be removed.
BUG=56081
TEST=Manual, double click on input field in fillable form, fill the form, notice that clicked field now fills correctly.
Review URL: http://codereview.chromium.org/3414015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60238 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/form_manager.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc index 048f347..17fb9aa 100644 --- a/chrome/renderer/form_manager.cc +++ b/chrome/renderer/form_manager.cc @@ -875,6 +875,12 @@ void FormManager::FillFormField(WebKit::WebFormControlElement* field, // If the maxlength attribute contains a negative value, maxLength() // returns the default maxlength value. + // TODO(dhollowa): The call here to |setSuggestedValue| is a work-around + // to a WebKit change in r67122. See http://crbug.com/56081 for details. + // Once the core issue is fixed in WebKit, this work-around should be + // removed. + input_element.setSuggestedValue( + data->value().substr(0, input_element.maxLength())); input_element.setValue(data->value().substr(0, input_element.maxLength())); input_element.setAutofilled(true); } else if (field->formControlType() == WebString::fromUTF8("select-one")) { |