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.
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."
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.
Comment on attachment 55912 [details] patch This seems safe enough.
Comment on attachment 55912 [details] patch Clearing flags on attachment: 55912 Committed r59472: <http://trac.webkit.org/changeset/59472>
All reviewed patches have been landed. Closing bug.