Bug 19005 - GET form items without name attribute are still submitted
Summary: GET form items without name attribute are still submitted
Status: RESOLVED DUPLICATE of bug 20184
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-12 06:30 PDT by Wim Leers
Modified: 2009-03-02 03:56 PST (History)
1 user (show)

See Also:


Attachments
a test that doesn't fail (274 bytes, text/html)
2008-05-12 06:39 PDT, Alexey Proskuryakov
no flags Details
Test case that uses a select element, which does show the bug. (328 bytes, text/html)
2008-05-12 06:48 PDT, Wim Leers
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Leers 2008-05-12 06:30:32 PDT
When you have for example a select element in a GET form, then remove its name attribute after it has been loaded (using Javascript), then submit the form, WebKit will *still* append the value to the URL, but set no name attribute.

E.g. http://foo.com/somepage?=value, where "value" is the selected value of the select.

Notes:
- I did not test if this also happens with POST forms.
- I did not test if this also happens when you don't have a name attribute from the beginning. (I tested with a document that has a name attribute set in the beginning and removed it afterwards, using JS.)
Comment 1 Alexey Proskuryakov 2008-05-12 06:39:46 PDT
Created attachment 21078 [details]
a test that doesn't fail

I cannot reproduce the problem using this test case.
Comment 2 Wim Leers 2008-05-12 06:48:08 PDT
Created attachment 21079 [details]
Test case that uses a select element, which does show the bug.

When I run your test example, a question mark gets appended to the URL. I'm not sure if that's correct, but that seems like a bug to me?

Anyway, I've updated your test case to use a select element, and now it does happen. I guess it only happens with select elements.
Comment 3 Alexey Proskuryakov 2008-05-12 06:53:56 PDT
Confirmed with r33044; not a regression from latest shipping WebKit.

(In reply to comment #2)
> Test case that uses a select element, which does show the bug.

Sorry, I should have thought of testing with select, as you described originally.

> When I run your test example, a question mark gets appended to the URL. I'm not
> sure if that's correct, but that seems like a bug to me?

We match Firefox in this regard. Also, appears to match the steps in paragraph 17.13.3 of HTML 4.01 spec.
Comment 4 Wim Leers 2008-05-12 06:57:32 PDT
> Confirmed with r33044; not a regression from latest shipping WebKit.
Excellent. I don't think it'll be too hard to fix this, and while annoying, one can live with this. This is my first "contribution" to WebKit :)

> Sorry, I should have thought of testing with select, as you described
> originally.
No problem :) I'm already amazed by the professionalism and speed of your reply!

> > When I run your test example, a question mark gets appended to the URL. I'm not
> > sure if that's correct, but that seems like a bug to me?
> 
> We match Firefox in this regard. Also, appears to match the steps in paragraph
> 17.13.3 of HTML 4.01 spec.

Ok, I had a suspicion that wasn't a bug :)


Keep on rocking, WebKit Team! :)
Comment 5 Alexey Proskuryakov 2009-03-02 03:56:35 PST
This bug was filed earlier, but bug 20184 got a fix, marking as a duplicate.

*** This bug has been marked as a duplicate of 20184 ***