Bug 97177

Summary: [Forms] HTMLSelectElement should call formStateDidChange on both menulist and lisbox mode
Product: WebKit Reporter: yosin
Component: FormsAssignee: yosin
Status: RESOLVED FIXED    
Severity: Normal CC: mifenton, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch 1 none

Description yosin 2012-09-19 23:33:29 PDT
When HTMLSelectElement is menulist mode, it calls formStateDidChange(), however when it is listbox mode, it doesn't.

There is a similar bug for multiple field time input UI:
bug 97169 - [Forms] multiple fields time input UI should call notifyFormStateChanged() when value of field is changed
Comment 1 yosin 2012-09-20 01:22:45 PDT
Created attachment 164857 [details]
Patch 1
Comment 2 yosin 2012-09-20 01:23:32 PDT
Comment on attachment 164857 [details]
Patch 1

Could you review this patch?
Thanks in advance.
Comment 3 Kent Tamura 2012-09-20 01:33:23 PDT
Comment on attachment 164857 [details]
Patch 1

View in context: https://bugs.webkit.org/attachment.cgi?id=164857&action=review

> Source/WebCore/html/HTMLSelectElement.cpp:635
> +    notifyFormStateChanged();

Are there other places which should have notifyFromStateChanged()?

I think calling notifyFromStateChanged() in listBoxOnChange() and dispatchChangeEventForMenuList() is more reliable.
Comment 4 Kent Tamura 2012-09-20 01:35:31 PDT
Comment on attachment 164857 [details]
Patch 1

View in context: https://bugs.webkit.org/attachment.cgi?id=164857&action=review

>> Source/WebCore/html/HTMLSelectElement.cpp:635
>> +    notifyFormStateChanged();
> 
> Are there other places which should have notifyFromStateChanged()?
> 
> I think calling notifyFromStateChanged() in listBoxOnChange() and dispatchChangeEventForMenuList() is more reliable.

> I think calling notifyFromStateChanged() in listBoxOnChange() and dispatchChangeEventForMenuList() is more reliable.

Ah, no.  If we do so, state change by JavaScript won't update the state.
Comment 5 yosin 2012-09-20 01:40:10 PDT
(In reply to comment #4)
> (From update of attachment 164857 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=164857&action=review
> 
> >> Source/WebCore/html/HTMLSelectElement.cpp:635
> >> +    notifyFormStateChanged();
> > 
> > Are there other places which should have notifyFromStateChanged()?
> > 
> > I think calling notifyFromStateChanged() in listBoxOnChange() and dispatchChangeEventForMenuList() is more reliable.
> 
> > I think calling notifyFromStateChanged() in listBoxOnChange() and dispatchChangeEventForMenuList() is more reliable.
> 
> Ah, no.  If we do so, state change by JavaScript won't update the state.

Agree, it seems notifyFormStateChanged() is called with setNeedValidityCheck() in other types.
Comment 6 yosin 2012-09-20 01:41:00 PDT
Comment on attachment 164857 [details]
Patch 1

Clearing flags on attachment: 164857

Committed r129107: <http://trac.webkit.org/changeset/129107>
Comment 7 yosin 2012-09-20 01:41:05 PDT
All reviewed patches have been landed.  Closing bug.