Bug 133967 - [testcase] <form> target= sends data to wrong target
Summary: [testcase] <form> target= sends data to wrong target
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 3.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-12 16:12 UTC by JohnS
Modified: 2009-04-03 01:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Main testcase file containing iframe target (testcase.html) (177 bytes, text/html)
2006-10-26 10:50 UTC, Jiri Kaderavek
Details
Contain of iframe to which the form is posted (testcase2.html) (80 bytes, text/html)
2006-10-26 10:52 UTC, Jiri Kaderavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description JohnS 2006-09-12 16:12:37 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs

Imagine that you have loaded the same webpage two (or more) times, in two (or more) different tabs in Konqueror.

That page has a <form target="i"> and a <iframe name="i"> (so that the action="" of the form will be loaded into the iframe with name "i")

Ok, now submit the form in all the tabs, only one of the tab's iframe will get updated.

--

Testcase, create these files in the same directory:
create form_target_test_1.html:
<html><body>
<form action="form_target_test_3.html" target="ifr">
<input type="text" name="txt">
<input type="submit" value="Submit"></form>
<iframe name="ifr" src="form_target_test_2.html"></iframe>
</body></html>

create form_target_test_2.html (default iframe content):
<html><body>
Form hasn't been submitted yet.
</body></html>

create form_target_test_3.html (form action):
<html><body>
FORM SUBMITTED!!!!!11.
</body></html>

Open form_target_test_1.html several times in several tabs. 
Hit their submit buttons.
Notice how only one iframe on one of the tabs will get updated.

Note:
In Firefox each of the different iframes in each page instance will get updated as expected.
Comment 1 Jiri Kaderavek 2006-10-26 10:49:48 UTC
I can confirm this bug, testcase.html and testcase2.html attached. Put these files in the same directory, and then open testcase.html in two tabs and then press 'Send' on each other repeatedly. Soon you will notice, that form POSTs the data into another tabs iframe. Whats worse, that you can have two directories (under the same domain - but not sure if this issue is domain specific) with pages which contains the same name for iframe target and the issue exists too.
Comment 2 Jiri Kaderavek 2006-10-26 10:50:57 UTC
Created attachment 18272 [details]
Main testcase file containing iframe target (testcase.html)
Comment 3 Jiri Kaderavek 2006-10-26 10:52:46 UTC
Created attachment 18273 [details]
Contain of iframe to which the form is posted (testcase2.html)
Comment 4 Martin Fitzpatrick 2007-01-12 23:20:07 UTC
Confirmed on KDE 3.5.5 / Kubuntu 6.10.

Note that to reproduce you only need the first file ( http://bugs.kde.org/attachment.cgi?id=18272&action=view ). Although submitting the form will return a 404 it is still possible to see the bug.

Interestingly the iframe that gets updated appears to be whichever one is being viewed at the moment the form is submitted. To test this open 4 tabs (right-click -> duplicate), submit the first one and then quickly click on another - this one will refresh with the submitted page (or 404 error).

When this happens, the original page remains untouched and it becomes "impossible" to submit (at least visibly) without loading the page fresh again.
Comment 5 Martin Fitzpatrick 2008-04-08 16:55:26 UTC
Confirmed this bug still exists on KDE4.0.3 but worse :) Now if you open the test file ( http://bugs.kde.org/attachment.cgi?id=18272&action=view ) in multiple tabs, no matter which one you submit only the frame in the first tab will fill with data.
Comment 6 Martin Fitzpatrick 2008-04-08 17:07:40 UTC
Correction: the tab the submit goes to is not fixed, e.g. if you actually submit to the first tab it may go to another one.

Also note bug 160568 ( http://bugs.kde.org/show_bug.cgi?id=160568 ). If you submit this form 3 times Konqueror will crash.
Comment 7 David Faure 2009-04-03 01:18:52 UTC
SVN commit 948414 by dfaure:

When looking for a frame by name, look first in the calling part. Makes a difference in case of duplicates...
Fix will be in 4.2.3.
BUG: 133967


 M  +8 -5      konqmainwindow.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=948414