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

Unified Diff: webkit/glue/form_field.cc

Issue 2832064: Fix for: State in small letters should be auto-filled from the profile.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « webkit/glue/form_field.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/form_field.cc
===================================================================
--- webkit/glue/form_field.cc (revision 52815)
+++ webkit/glue/form_field.cc (working copy)
@@ -7,11 +7,15 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebInputElement.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebOptionElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSelectElement.h"
using WebKit::WebFormControlElement;
+using WebKit::WebElement;
using WebKit::WebInputElement;
+using WebKit::WebOptionElement;
using WebKit::WebSelectElement;
+using WebKit::WebVector;
namespace webkit_glue {
@@ -37,6 +41,14 @@
} else if (form_control_type_ == ASCIIToUTF16("select-one")) {
WebSelectElement select_element = element.to<WebSelectElement>();
value_ = select_element.value();
+
+ // For select-one elements copy option strings.
+ WebVector<WebElement> list_items = select_element.listItems();
+ option_strings_.reserve(list_items.size());
+ for (size_t i = 0; i < list_items.size(); ++i) {
+ if (list_items[i].hasTagName("option"))
+ option_strings_.push_back(list_items[i].to<WebOptionElement>().value());
+ }
}
TrimWhitespace(value_, TRIM_LEADING, &value_);
« no previous file with comments | « webkit/glue/form_field.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698