Bug 20184

Summary: SELECT with no name generates invalid query string
Product: WebKit Reporter: Garrett Smith <xk1t>
Component: FormsAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, browserbugs2, ian, soapergem, work
Priority: P2 Keywords: HasReduction, InRadar
Version: 525.x (Safari 3.1)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Test Case Showing Problem
none
Test Case Showing Problem
none
Test Case Showing Problem
none
Test Case Showing Problem
none
Test Case Showing Problem
none
proposed fix
darin: review+
Simpler testcase. none

Garrett Smith
Reported 2008-07-27 00:24:51 PDT
A SELECT element with no name is submitted. A SELECT with a selected, disabled OPTION submits the disabled OPTION. This results in the unsuccessful controls generating values in query strings and invalid query strings: ?=invalid&=&wrong=disabled#done * "invalid" is the selected OPTION of a SELECT that has no name * "&=" is the selected OPTION with no value of a SELECT that has no name * "wrong=disabled" is the selected OPTION with the value "disabled" of a SELECT with the name "wrong" Instead, the submit with no name should not be submitted and disabled OPTIONS should not be submitted. If the selected option does not have a value, the browser may consider the select to be unsuccessful. This would result in either the query string "wrong=" or no query string. If there is no OPTION selected, the browser may select the first OPTION or the first enabled OPTION. This would result in the test case: 1) (no query string) 2) wrong=enabled (only if the enabled OPTION were default selected). | If a control doesn't have a current value when the form is | submitted user agents are not required to treat it as a successful | control." [1] [1] HTML 4.01, Forms, Successful Controls. http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2
Attachments
Test Case Showing Problem (1.07 KB, text/html)
2008-07-27 00:33 PDT, Garrett Smith
no flags
Test Case Showing Problem (1.22 KB, text/html)
2008-07-27 00:44 PDT, Garrett Smith
no flags
Test Case Showing Problem (1.17 KB, text/html)
2008-07-27 20:33 PDT, Garrett Smith
no flags
Test Case Showing Problem (1.17 KB, text/html)
2008-07-27 22:13 PDT, Garrett Smith
no flags
Test Case Showing Problem (1.37 KB, text/html)
2008-07-27 23:05 PDT, Garrett Smith
no flags
proposed fix (4.47 KB, patch)
2009-02-16 06:54 PST, Alexey Proskuryakov
darin: review+
Simpler testcase. (1.02 KB, text/html)
2010-06-19 11:31 PDT, Garrett Smith
no flags
Garrett Smith
Comment 1 2008-07-27 00:33:38 PDT
Created attachment 22499 [details] Test Case Showing Problem ?=invalid&=&wrong=disabled#done Also of note: in Firefox, the disabled options are not selected unless they have the selected attribute. This is perfectly valid and affords the developer more control and flexibility. Safari Version 3.1.1 (4525.18), navigator.userAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18
Garrett Smith
Comment 2 2008-07-27 00:44:46 PDT
Created attachment 22501 [details] Test Case Showing Problem Bring in the bug id "id=" param for bugs.webkit.org bug id.
Mark Rowe (bdash)
Comment 3 2008-07-27 00:57:47 PDT
Garrett Smith
Comment 4 2008-07-27 20:33:12 PDT
Created attachment 22512 [details] Test Case Showing Problem
Garrett Smith
Comment 5 2008-07-27 22:13:28 PDT
Created attachment 22517 [details] Test Case Showing Problem
Garrett Smith
Comment 6 2008-07-27 23:05:34 PDT
Created attachment 22519 [details] Test Case Showing Problem
GĂ©rard Talbot (no longer involved)
Comment 7 2008-08-31 17:24:36 PDT
There is an identical bug at bugs.kde.org: B u g 148981: Do not submit disabled option in combobox https://bugs.kde.org/show_bug.cgi?id=148981
Alexey Proskuryakov
Comment 8 2009-02-16 06:54:08 PST
Created attachment 27697 [details] proposed fix This patch fixes the "select with no name" issue. As far as "disabled selected option" goes, this is a separate issue that needs to be discussed in a separate bug, especially since we match IE behavior here.
Alexey Proskuryakov
Comment 9 2009-02-23 00:46:47 PST
Comment on attachment 27697 [details] proposed fix Oops, I clicked the wrong option when submitting the patch! Marking for review now.
Darin Adler
Comment 10 2009-02-23 00:55:01 PST
Comment on attachment 27697 [details] proposed fix r=me
Alexey Proskuryakov
Comment 11 2009-02-23 01:23:21 PST
Committed revision 41135.
Alexey Proskuryakov
Comment 12 2009-03-02 03:56:35 PST
*** Bug 19005 has been marked as a duplicate of this bug. ***
Garrett Smith
Comment 13 2010-06-19 11:31:38 PDT
Created attachment 59190 [details] Simpler testcase. Submitting better testcase to FIXED bug for future reference/clarity -- the previous testcase was confusing.
Alexey Proskuryakov
Comment 14 2011-05-20 08:49:17 PDT
*** Bug 21478 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.