summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 17:42:32 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 17:42:32 +0000
commitf909f7b6df9d49f44dd3ba3a52018d7d1a1fda98 (patch)
tree17b5199ad2edd3f7e228d086ac3236f3f0b87240 /chrome
parent7ce7ec5629944fe869c76e66b82fce15db49cdfe (diff)
downloadchromium_src-f909f7b6df9d49f44dd3ba3a52018d7d1a1fda98.zip
chromium_src-f909f7b6df9d49f44dd3ba3a52018d7d1a1fda98.tar.gz
chromium_src-f909f7b6df9d49f44dd3ba3a52018d7d1a1fda98.tar.bz2
Input value appears twice on the form field
Changes Autocomplete filling to force preview of "suggested" Autocomplete value before setting the value proper. This accounts for the delayed refresh of the WebCore HTMLInputElement UI where |HTMLInputElement::setValue()| defers UI refresh until the control loses focus. BUG=50426 TEST=Manual test according to bug. Review URL: http://codereview.chromium.org/3015049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/autofill_helper.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/renderer/autofill_helper.cc b/chrome/renderer/autofill_helper.cc
index 1ed6b09..ea1b4a7 100644
--- a/chrome/renderer/autofill_helper.cc
+++ b/chrome/renderer/autofill_helper.cc
@@ -167,6 +167,10 @@ void AutoFillHelper::DidAcceptAutoFillSuggestion(const WebNode& node,
} else if (form_manager_.FormWithNodeIsAutoFilled(node) || !unique_id) {
// User selected an Autocomplete entry, so we fill directly.
WebInputElement element = node.toConst<WebInputElement>();
+
+ // Set the suggested value to update input element value immediately in UI.
+ // The |setValue| call has update delayed until element loses focus.
+ element.setSuggestedValue(value);
element.setValue(value);
WebFrame* webframe = node.document().frame();