[webkit-reviews] review granted: [Bug 67742] Push more code from HTMLInputElement::setValue to TextFieldInputType::setValue : [Attachment 106699] Updated

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 8 12:41:03 PDT 2011

Darin Adler <darin at apple.com> has granted Ryosuke Niwa <rniwa at webkit.org>'s
request for review:
Bug 67742: Push more code from HTMLInputElement::setValue to

Attachment 106699: Updated

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=106699&action=review

> Source/WebCore/html/HTMLInputElement.cpp:1093
> +    m_suggestedValue = String(); // TextFieldInputType::setValue uses the
suggested value.

This comment does not make clear why clearing the suggested value is the
correct thing to do. Neither did the old comment.

> Source/WebCore/html/HTMLInputElement.cpp:1104
> +    // FIXME: why do we do this when !sendChangeEvent?

The word “why” should be capitalized.

> Source/WebCore/html/TextFieldInputType.cpp:98
> +    if (element()->focused())
> +	   element()->dispatchFormControlInputEvent();
> +    else
> +	   element()->dispatchFormControlChangeEvent();

I think this should use early return instead of else, and call through to the
base class dispatchChangeEventInResponseToSetValue instead of calling
dispatchFormControlChangeEvent after the early return.

More information about the webkit-reviews mailing list