Commit 8fa8f32f authored by sebsg's avatar sebsg Committed by Commit Bot

[AF] Remove yellow backgroung on input field when site resets it.

Bug: 839859
Change-Id: I198b4cf906ed1eabb250c56282b34d96dbd53415
Reviewed-on: https://chromium-review.googlesource.com/1045174Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556772}
parent ad821d5d
...@@ -729,8 +729,10 @@ void PasswordAutofillAgent::PasswordValueGatekeeper::Reset() { ...@@ -729,8 +729,10 @@ void PasswordAutofillAgent::PasswordValueGatekeeper::Reset() {
void PasswordAutofillAgent::PasswordValueGatekeeper::ShowValue( void PasswordAutofillAgent::PasswordValueGatekeeper::ShowValue(
blink::WebInputElement* element) { blink::WebInputElement* element) {
if (!element->IsNull() && !element->SuggestedValue().IsEmpty()) if (!element->IsNull() && !element->SuggestedValue().IsEmpty()) {
element->SetAutofillValue(element->SuggestedValue()); element->SetAutofillValue(element->SuggestedValue());
element->SetAutofilled(true);
}
} }
bool PasswordAutofillAgent::TextDidChangeInTextField( bool PasswordAutofillAgent::TextDidChangeInTextField(
......
<input id="input" value="" style="width: 99px">
\ No newline at end of file
<input id="input" >
<script>
input.focus();
internals.setAutofilledValue(input, 'Springfield');
input.style.width = '99px';
input.blur();
input.value = "";
</script>
...@@ -1123,6 +1123,10 @@ void HTMLInputElement::setValue(const String& value, ...@@ -1123,6 +1123,10 @@ void HTMLInputElement::setValue(const String& value,
// update. // update.
TextControlElement::SetSuggestedValue(String()); TextControlElement::SetSuggestedValue(String());
// Set autofilled to false, as the value might have been set by the website.
// If the field was autofilled, it'll be set to true from that method.
SetAutofilled(false);
EventQueueScope scope; EventQueueScope scope;
String sanitized_value = SanitizeValue(value); String sanitized_value = SanitizeValue(value);
bool value_changed = sanitized_value != this->value(); bool value_changed = sanitized_value != this->value();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment