Summary: | <form> tags used without action attribute but with a <base> tag | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Robert Sesek <rsesek> | ||||||||
Component: | Forms | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | VERIFIED FIXED | ||||||||||
Severity: | Normal | CC: | ap | ||||||||
Priority: | P2 | ||||||||||
Version: | 523.x (Safari 3) | ||||||||||
Hardware: | Mac | ||||||||||
OS: | OS X 10.5 | ||||||||||
Attachments: |
|
Description
Robert Sesek
2008-01-27 23:06:47 PST
Created attachment 18734 [details]
Testcase
Both Firefox 2.0.0.9 and IE7 seem to ignore base URI when submitting this form (and submit to <http://bugs.webkit.org/attachment.cgi?submit=Submit+The+Form>). Are you seeing different results? Does this issue affect any actual sites? This would make it more important, of course. Confirming as a difference with IE and Firefox, but I'm not sure what behavior would be best. The only site that I've experienced this issue on is the internal website we use at my job, so the criticality of it is very low (as far as I can tell). As for the behavior, logically I think it makes the most sense to submit to (from the attachment): http://localhost/foo/zoo/base/attachment.cgi?submit=Submit+The+Form The reasoning: you take the <base> because all relative URIs should be resolved from that. Then concatenate the originating page's basename (in this case attachment.cgi) because when <form>s do not have an action attribute, it submits to the originating page. However, this would probably break away from the implementation of IE and FF, so perhaps just submitting to the full URL of the originating page is the best way to do it. Created attachment 18741 [details]
Patch using FF and IE implementation
Here's a patch that would implement the Firefox and IE behavior.
Comment on attachment 18741 [details]
Patch using FF and IE implementation
Thanks for contributing this fix!
The code change looks OK to me, but we need a regression test. That's the policy for the WebKit project -- we require a test for any bug we fix.
The LayoutTests/fast/forms directory has lots of form tests. You can probably start with one of those to make a test. For example, empty-get.html.
Created attachment 18808 [details]
Patch, take 2
Sorry about not submitting the test, I'm not familiar with the procedure. I have updated the patch to include a layout test for this bug.
Comment on attachment 18808 [details]
Patch, take 2
r=me
|