Bug 62668 - Webkit allows disabled option as value of "required" select
Summary: Webkit allows disabled option as value of "required" select
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 15:35 PDT by Rafał Miłecki
Modified: 2011-06-20 20:00 PDT (History)
4 users (show)

See Also:


Attachments
Testcase for the bug (590 bytes, text/html)
2011-06-14 15:35 PDT, Rafał Miłecki
no flags Details
Patch (3.72 KB, patch)
2011-06-15 23:58 PDT, Dai Mikurube
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Patch
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]
Patch

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

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.