Bug 62668

Summary: Webkit allows disabled option as value of "required" select
Product: WebKit Reporter: Rafał Miłecki <zajec5>
Component: FormsAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: ap, dmikurube, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Testcase for the bug
Patch none

Description Rafał Miłecki 2011-06-14 15:35:18 PDT
"required" attribute tells browser value has to be entered for a given input/select. AFAIK choosing disabled option with no value should generate form validation error.
Comment 1 Rafał Miłecki 2011-06-14 15:35:55 PDT
Created attachment 97175 [details]
Testcase for the bug
Comment 2 Kent Tamura 2011-06-15 17:12:12 PDT
HTMLSelectElement::hasPlaceHolderLabelOption() checks option->disabled(), but the current specification doesn't ask to check 'disabled' for placeholder label option.

I don't remember why we added the option->disabled() check. The specification might have been updated.
Comment 3 Dai Mikurube 2011-06-15 23:22:34 PDT
Yes, the specification looks like updated.

http://www.w3.org/TR/2010/WD-html5-20101019/the-button-element.html#placeholder-label-option says:
> If a ... is the empty string, and that option is not disabled, and, finally, 
that option element's parent node ....

http://www.w3.org/TR/2011/WD-html5-20110525/the-button-element.html#placeholder-label-option says:
> If a ... is the empty string, and that option element's parent node ....

I'll try fixing it.
Comment 4 Dai Mikurube 2011-06-15 23:58:46 PDT
Created attachment 97409 [details]
Comment 5 Dai Mikurube 2011-06-16 00:03:51 PDT
Ah, I uploaded the patch from dmikurube@google.com.  It's me, dmikurube@chromium.org.
Comment 6 Kent Tamura 2011-06-20 19:20:12 PDT
Comment on attachment 97409 [details]

Comment 7 WebKit Review Bot 2011-06-20 20:00:28 PDT
Comment on attachment 97409 [details]

Clearing flags on attachment: 97409

Committed r89332: <http://trac.webkit.org/changeset/89332>
Comment 8 WebKit Review Bot 2011-06-20 20:00:33 PDT
All reviewed patches have been landed.  Closing bug.