diff options
-rw-r--r-- | chrome/renderer/autofill_helper.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/password_autocomplete_manager.cc | 5 | ||||
-rw-r--r-- | webkit/glue/dom_operations.cc | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/chrome/renderer/autofill_helper.cc b/chrome/renderer/autofill_helper.cc index 273a7c8..bc4c330 100644 --- a/chrome/renderer/autofill_helper.cc +++ b/chrome/renderer/autofill_helper.cc @@ -229,8 +229,8 @@ void AutoFillHelper::ShowSuggestions( // We need to call non-const methods. WebInputElement element(const_element); if (!element.isEnabledFormControl() || - element.inputType() != WebInputElement::Text || - element.inputType() == WebInputElement::Password || + !element.isText() || + element.isPasswordField() || !element.autoComplete() || element.isReadOnly()) { return; } diff --git a/chrome/renderer/password_autocomplete_manager.cc b/chrome/renderer/password_autocomplete_manager.cc index 3e49a6d..83a037e 100644 --- a/chrome/renderer/password_autocomplete_manager.cc +++ b/chrome/renderer/password_autocomplete_manager.cc @@ -131,10 +131,11 @@ bool FillForm(FormElements* fe, const webkit_glue::FormData& data) { WebKit::WebInputElement& element = it->second; if (!element.value().isEmpty()) // Don't overwrite pre-filled values. continue; - if (element.inputType() == WebKit::WebInputElement::Password && + if (element.isPasswordField() && (!element.isEnabledFormControl() || element.hasAttribute("readonly"))) { continue; // Don't fill uneditable password fields. } + // TODO(tkent): Check maxlength and pattern. element.setValue(data_map[it->first]); element.setAutofilled(true); element.dispatchFormControlChangeEvent(); @@ -266,7 +267,7 @@ bool PasswordAutocompleteManager::TextDidChangeInTextField( return false; if (!element.isEnabledFormControl() || - element.inputType() != WebKit::WebInputElement::Text || + !element.isText() || !element.autoComplete() || element.isReadOnly()) { return false; } diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index f9868b2..22e0e75 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -186,7 +186,7 @@ static bool FillFormImpl(FormElements* fe, const FormData& data) { WebKit::WebInputElement& element = it->second; if (!element.value().isEmpty()) // Don't overwrite pre-filled values. continue; - if (element.inputType() == WebInputElement::Password && + if (element.isPasswordField() && (!element.isEnabledFormControl() || element.hasAttribute("readonly"))) { continue; // Don't fill uneditable password fields. } @@ -314,7 +314,7 @@ WebString GetSubResourceLinkFromElement(const WebElement& element) { attribute_name = "src"; } else if (element.hasTagName("input")) { const WebInputElement input = element.toConst<WebInputElement>(); - if (input.inputType() == WebInputElement::Image) { + if (input.isImageButton()) { attribute_name = "src"; } } else if (element.hasTagName("body") || |