RESOLVED FIXED Bug 39032
Don't clear yellow autofill highlight until user edits value
https://bugs.webkit.org/show_bug.cgi?id=39032
Summary Don't clear yellow autofill highlight until user edits value
Jens Alfke
Reported 2010-05-12 15:59:09 PDT
The 'autofilled' flag (and yellow background highlight) on a text field gets cleared when the field is focused. This can have weird results — for example, if there's an onload handler on the page that focuses a particular field, then that field won't appear autofilled even though it was. Also, if password fields get autofilled (as Chrome does), then a form's fields turn yellow again as soon as you tab out, since the browser applies the autofill again. This got reported against Chrome as: http://code.google.com/p/chromium/issues/detail?id=38386 The specific behaviors called out there apply to Chrome, but the autofill highlight is part of WebKit. I propose that HTMLInputField be changed slightly so that the autofill flag isn't cleared until the field is actually changed by the user, not just tabbed through. This seems more consistent in that the highlight then applies to the _contents_ of the field, showing that it's still a value supplied automatically by the browser and not hand-typed.
Attachments
patch (1.62 KB, patch)
2010-05-12 16:52 PDT, Jens Alfke
no flags
Jens Alfke
Comment 1 2010-05-12 16:52:43 PDT
Created attachment 55912 [details] patch FYI, I asked about this change on webkit-dev, and John Sullivan was OK with it: "It seems reasonable to me that the autofilled property is only cleared when the text is modified by the user. Since it is a visible change in the behavior, there's always a chance that it will not sit well with everyone and we might eventually have to allow for both behaviors somehow. But it seems like a small enough behavior change that it's unlikely that anyone will care strongly about it."
John Sullivan
Comment 2 2010-05-12 17:23:39 PDT
I think we could implement the old behavior on top of the new code by having the client notice the focus event and explicitly call setAutofilled(false), so that makes the new code seem even safer than I previously thought.
John Sullivan
Comment 3 2010-05-12 17:25:09 PDT
Comment on attachment 55912 [details] patch This seems safe enough.
WebKit Commit Bot
Comment 4 2010-05-14 07:17:01 PDT
Comment on attachment 55912 [details] patch Clearing flags on attachment: 55912 Committed r59472: <http://trac.webkit.org/changeset/59472>
WebKit Commit Bot
Comment 5 2010-05-14 07:17:06 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.