[Webkit-unassigned] [Bug 20780] when choosing an auto-completed value in a text input field the javascript 'change' event is not fired.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 1 14:06:12 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=20780





--- Comment #15 from Darin Adler <darin at apple.com>  2009-11-01 14:06:11 PDT ---
(From update of attachment 42279)
I'm now comfortable with the code change after your explanation.

I'm still slightly puzzled that we can't exercise this code path any way in
DumpRenderTree, but you say so and I'll take your word for it. Maybe there's
something simple we can do in DumpRenderTree so it can simulate the auto-fill
code path just enough so this can be regression tested.

> -        m_edited = false;
> +        // We set m_userEdited to false so that we do not ignore the HTML 5 autofocus attribute on this form control.

This seems like a really mysterious comment. I don't understand how autofocus
is related to this.

> +        // Why do we set this directly as opposed to calling setUserEdited(false) here?

This comment isn't needed. It's common to set data members inside a class
rather than calling functions, and that's probably a good idiom.

In fact, I think it would be best to eliminate the setUserEdited function
entirely. As far as I can tell nobody calls it.

> +    // Note, after you fire an onchange event, remember to call setEdited(false) to reset the edited state of this control.
>      bool isEdited() const { return m_edited; }
>      void setEdited(bool isEdited) { m_edited = isEdited; }

This comment points out the need for a design change. We don't want to make
functions you can "use wrong" if we can avoid it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list