Bug 18401

Summary: Apparent caching between form submits 2
Product: WebKit Reporter: Peter Enevoldsen <pen>
Component: HistoryAssignee: Kevin McCullough <kmccullough>
Status: RESOLVED FIXED    
Severity: Critical CC: cl, kmccullough, maje, pen
Priority: P1 Keywords: InRadar
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
URL: http://demo.maconomy.com
Attachments:
Description Flags
Screenshot 1
none
Screenshot 2
none
Proposed fix. Needs a layout test.
kmccullough: review-
Proposed test
none
Proposed test 2
none
Fix and layout test mitz: review+

Description Peter Enevoldsen 2008-04-10 02:42:24 PDT
Some values in a form is apparently cached after submit and when we submit a new form the previous values are shown in the new form.

When we navigate away and thereby submit the framed form (Picture 1) 
we go to Picture 2. The form in picture 2 contains the same values 
as the framed form in Picture 1.

Steps to Reproduce:
1. Set your user agent to "Safari 2.0.4"
2. http://193.17.206.202/cgi-bin/Maconomy/MaconomyPortal.mas11.W_MAS/Framework/maconomyportal.msc
3. Login as "Kevin Sullivan" password 123456
4. Click "Job Management" -> "My Jobs" -> Job no:  2010001
5. navigate between the tabs and see that the values from the previous form are briefly shown before the real data.

A more simple alternative is:
1. Open "Job Management" -> "New Job"
2. Select an element in the drop down.
3. Click next.
4. The element you selected in the dropdown is brifly shown in the "Client/Brand" field

Expected Results:
On previous versions of Safari and Firefox and IE the form 
would not contain any values. e.g no values are "copied"/cached 
between the two forms.
 
Actual Results:
Explain what actually occurred when steps above are executed.

Regression:
This worked in Safari 2 on Panther and Tiger

I found that r25410 introduces the problem. The code that causes the problem is shown below in snippet 1. If I reuse addHistoryForCurrentLocation I dont see the problem, but it of course introduces other problems (as mentioned in the code - 5333496).

I did the test in r29336

FrameLoader.cpp

Snippet 1:
    if (!frameNavigationOnLoad && !documentLoader()->isClientRedirect()) {
        if (!documentLoader()->urlForHistory().isEmpty())
            addHistoryForCurrentLocation();
    } else if (documentLoader()->unreachableURL().isEmpty() && m_currentHistoryItem) {
        m_currentHistoryItem->setURL(documentLoader()->url());
        m_currentHistoryItem->setFormInfoFromRequest(documentLoader()->request());
    }

Snippet 2:
    if (!frameNavigationOnLoad && !documentLoader()->isClientRedirect()) {
        if (!documentLoader()->urlForHistory().isEmpty())
            addHistoryForCurrentLocation();
    } else if (documentLoader()->unreachableURL().isEmpty() && m_currentHistoryItem) {
//        m_currentHistoryItem->setURL(documentLoader()->url());
//       m_currentHistoryItem->setFormInfoFromRequest(documentLoader()->request());
            addHistoryForCurrentLocation();
    }
Comment 1 Peter Enevoldsen 2008-04-10 02:55:42 PDT
Created attachment 20451 [details]
Screenshot 1
Comment 2 Peter Enevoldsen 2008-04-10 02:56:00 PDT
Created attachment 20452 [details]
Screenshot 2
Comment 3 Mark Malone 2008-04-10 09:24:46 PDT
rdar://5620273
Comment 4 Peter Enevoldsen 2008-05-22 02:43:28 PDT
After advise from andersc I tried to set autocomplete=false on the form. It did not help.
Comment 5 Kevin McCullough 2008-06-10 14:03:38 PDT
It looks like frames are not setting createdByParser in HTMLElementFactory (nor iFrames).  I have a fix for that but can't create a reduction to reproduce currently.  I think there is a combination of iframes and frames going on.
Comment 6 Kevin McCullough 2008-06-25 10:29:38 PDT
Created attachment 21934 [details]
Proposed fix.  Needs a layout test.
Comment 7 Peter Enevoldsen 2008-07-14 11:21:01 PDT
Created attachment 22267 [details]
Proposed test
Comment 8 Peter Enevoldsen 2008-07-15 03:39:50 PDT
Created attachment 22279 [details]
Proposed test 2

I updated the test so it complies better with the layout test standards.
Comment 9 Kevin McCullough 2008-07-15 16:12:08 PDT
Comment on attachment 21934 [details]
Proposed fix.  Needs a layout test.

uploading new patch
Comment 10 Kevin McCullough 2008-07-15 16:13:15 PDT
Created attachment 22292 [details]
Fix and layout test
Comment 11 mitz 2008-07-15 16:25:09 PDT
Comment on attachment 22292 [details]
Fix and layout test

Property changes on: LayoutTests/fast/forms/form-and-frame-interaction-retains-values.html
___________________________________________________________________
Name: svn:executable
   + *

I don't think this needs to be set.

\ No newline at end of file

Please add a newline.

r=me
Comment 12 Kevin McCullough 2008-07-15 16:46:58 PDT
Committed revision 35188.
Comment 13 zaharang 2008-09-03 19:28:06 PDT
After this patch, the 'back' function do not work in some site.
ex) http://media.daum.net/politics/others/view.html?cateid=1010&newsid=20080903102907230&p=ned    (sorry for non-english site)