<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>23346</bug_id>
          
          <creation_ts>2009-01-15 03:14:42 -0800</creation_ts>
          <short_desc>Restore form control values to a wrong form</short_desc>
          <delta_ts>2012-09-13 11:11:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>525.x (Safari 3.2)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>26241</dependson>
    
    <dependson>36762</dependson>
    
    <dependson>53312</dependson>
    
    <dependson>88272</dependson>
    
    <dependson>88685</dependson>
    
    <dependson>88768</dependson>
    
    <dependson>89409</dependson>
    
    <dependson>89412</dependson>
    
    <dependson>89623</dependson>
    
    <dependson>89628</dependson>
    
    <dependson>89847</dependson>
    
    <dependson>89950</dependson>
    
    <dependson>89962</dependson>
    
    <dependson>90259</dependson>
    
    <dependson>90964</dependson>
    
    <dependson>91050</dependson>
    
    <dependson>91209</dependson>
    
    <dependson>91804</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Oleksandr Yevstafyev">oyevstaf</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>benjie</cc>
    
    <cc>bill</cc>
    
    <cc>brunner</cc>
    
    <cc>darin</cc>
    
    <cc>futurama</cc>
    
    <cc>ghollins</cc>
    
    <cc>michael</cc>
    
    <cc>oyevstaf</cc>
    
    <cc>priyajeet.hora</cc>
    
    <cc>service</cc>
    
    <cc>sullivan</cc>
    
    <cc>tkent</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105880</commentid>
    <comment_count>0</comment_count>
    <who name="Oleksandr Yevstafyev">oyevstaf</who>
    <bug_when>2009-01-15 03:14:42 -0800</bug_when>
    <thetext>Sometimes wrong form will be submitted if we play with Back button prior to sumbit.

Steps to reproduce:

1. Go to http://www.williams-sonoma.com, select a product from menu (for example, http://www.williams-sonoma.com/products/sku6463004/index.cfm?pkey=ccookware%2Dsets&amp;ckey=cookware%2Dsets).

2. Click &quot;Write a Review&quot; link, enter a email address, click &quot;CONTINUE&quot;, &quot;Write a Review&quot; page displays.

3. Enter nickname, specify rating value and whether you recommend the product to a friend, enter review headline and review text.

4. Click &quot;PREVIEW&quot;, &quot;Please Review Your Feedback&quot; page displays.

5. Click browser&apos;s &quot;Back&quot; button twice, each time cancel re-submitting the form as suggested by browser. Clicking once also may result in the error at step 6, but clicking twice increases the probability.

6. Click &quot;Edit&quot;. At this point wrong form is submitted sometimes. &quot;Wrong&quot; means that actual HTTP parameters sent to server are:

sp = S0
$ImageURLSubmit$0 = Preview
Form0 = $ValidHidden,$ValidHidden$0,sessionParams,inputRating,inputBuyAgain,inputDisplayName,inputTitle,inputReviewText,inputLocation,contextData,contextData$0,contextData$1,contextData$2,contextData$3,netPromoterScore,netPromoterComment,$ImageURLSubmit$0
service = direct/1/review-1031/$BazaarvoiceForm
$ImageURLSubmit$0.y = 12
$ImageURLSubmit$0.x = 12
returnURL = http://www.williams-sonoma.com/products/sku6463004/index.cfm?pkey=ccookware%2Dsets&amp;ckey=cookware%2Dsets

while expected (and actually rendered within the form) ones are:

sp = S0
$ImageURLSubmit$0 = Edit
Form0 = $ImageURLSubmit,$ImageURLSubmit$0,$ImageURLSubmit$1
service = direct/1/preview-1031/$BazaarvoiceForm
$ImageURLSubmit$0.y = 10
$ImageURLSubmit$0.x = 31
returnURL = http://www.williams-sonoma.com/products/sku6463004/index.cfm?pkey=ccookware%2Dsets&amp;ckey=cookware%2Dsets

Note the difference between actual and expected values of &quot;$ImageURLSubmit$0&quot; and &quot;Form0&quot; parameters. In fact, it looks like the form we filled in at step 3 is (partially) submitted instead of the form we see displayed before step 6.

Note, the error may not happen for first time. In this case, repeat steps 3-6 more times (if there is no error at step 6, you will be brought back to step 3 by the application).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112592</commentid>
    <comment_count>1</comment_count>
    <who name="OPAL Group Development">service</who>
    <bug_when>2009-03-06 08:30:18 -0800</bug_when>
    <thetext>This same problem is occurring in our system, exactly as described by the original bug author, only 100% reliably.  Only affects Safari/Chrome, and no other browsers.

Detail:
* We output multiple forms onto a page in a system that responds with a 302 redirect in response to a form submission.  So, in effect, the page submits to itself, but then redirects to a results page.
* The &quot;visible&quot; form that the interface renders is actually the 5th form in the HTML page.  The first 4 are stub forms with no interface elements, used for Javascript operations elsewhere on the page.

Steps to reproduce:
1) User submits the visible form, and is returned to a menu page.
2) User clicks on the same link again to re-load the form.
3) Rather than filling out the form, user clicks Back in the browser.

* PROBLEM #1:  In this case, the browser does NOT display the previous page.  Rather it displays the page with the form on it.  Possibly related to the 302 redirects, but cannot confirm this.

4) User then hits the Submit button on the page again.

* PROBLEM #2:  The browser does not submit the form that the Submit button is attached to.  Rather, the browser submits the _first_ form on the page, which is the hidden javascript-sensitive form.

We&apos;ve confirmed this behavior simply by re-ordering the forms as output to the page.  Whatever form appears first in the HTML is the form that will be submitted in response to clicking ANY submit button on the page, immediately following the browser Back.

Will attempt to distill this down to a simple test case that we&apos;ll post.  The actual system that it&apos;s in is both private-credentialed and overly complex to use as a test case.  We can reproduce this faithfully 100% of the time in our Production system, however.  Hopefully, we&apos;ll be able to provide a simplified example to add to the original submitter&apos;s.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112609</commentid>
    <comment_count>2</comment_count>
    <who name="OPAL Group Development">service</who>
    <bug_when>2009-03-06 09:45:06 -0800</bug_when>
    <thetext>Well, I can replicate HALF of the problem in a test case.  Posted an example here:
  http://penguin.theopalgroup.com/~jkilmer/bugs/

Unfortunately, I can only replicate the first part of the bad behavior.  The erroneous Back button behavior is accurately displayed by this example.  Unfortunately, the core problem (submitting the wrong form) doesn&apos;t occur in this simplified example.  Will continue trying to isolate the cause of that more serious problem, but you should at least be able to see the first part using this example.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112612</commentid>
    <comment_count>3</comment_count>
    <who name="OPAL Group Development">service</who>
    <bug_when>2009-03-06 09:56:22 -0800</bug_when>
    <thetext>So weird!!

Actually, the example in Comment #2 _can_ be used to recreate the entire problem.  It just requires MULTIPLE back button-clicks in this case, while our production system breaks with only a single back click.  Use the following steps:

0) Go to: http://penguin.theopalgroup.com/~jkilmer/bugs/
1) Click the &quot;CLICK HERE TO BEGIN&quot; link
2) Click the &quot;Load form: HERE&quot; link
3) Click Submit button
4) Click the &quot;Load form: HERE&quot; link
5) Click Browser BACK button
6) Click Submit button
7) Click Browser BACK button
8) Click Browser BACK button (second time)
9) Click the &quot;Load form: HERE&quot; link

WHAM!
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200186</commentid>
    <comment_count>4</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-16 08:02:45 -0700</bug_when>
    <thetext>This shows up for me in Safari/Chrome as well, on our production and testing sites.

Here is the scenario:

Page A: user is shown a form M, with hidden form field named X whose value is
M_X, and a submit form field named S whose value is M_S. There is also a form N, with hidden form field named X whose value is N_X, and a submit form field named S whose value is N_S

User POSTS to go to page B.

User hits back button to go back to Page A.

In form M, the value for X is now N_X, not M_X as it should be, and the value for S is N_S, not M_S.

I believe this scenario is caused by the same bug that caused the problems described in other comments related to this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200259</commentid>
    <comment_count>5</comment_count>
      <attachid>50802</attachid>
    <who name="">benjie</who>
    <bug_when>2010-03-16 09:43:24 -0700</bug_when>
    <thetext>Created attachment 50802
HTML files showing the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200263</commentid>
    <comment_count>6</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-16 09:49:45 -0700</bug_when>
    <thetext>I&apos;ve added some more examples. 

It&apos;s very easy to reproduce, at least some form of the bug.

First, untar the bug.tgz file

Scenario 1

1. In your Safari or Chrome, load x_bug.html
2. Don&apos;t submit anything, just click on the Next Page link
3. Click Back button
4. You will see that the first form now has field values from the second form

The interesting thing is that if you remove the &quot;autocomplete=off&quot; from x_bug.html, the problem goes away.

Scenario 2

1. cp x0_bug.html z.html
2. In your Safari or Chrome, load z.html
3. Click on &quot;First Form Submit&quot; button
4. cp x1_bug.html z.html
5. In browser, click on Back button
6. You will see that the new page in the browser, the page source and inspect element return different results. The page suppose to show form control from 2nd form from x1_bug.html, but instead it got old values from x0_bug.html.

Scenario 2 happens a lot on our website: we have a form, people submit the form, redirected to some other page, hours later the user&apos;s login session expires, user hits back button, and got a slightly different page, but the forms on the page are all messed up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>200424</commentid>
    <comment_count>7</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-16 14:07:02 -0700</bug_when>
    <thetext>I figured out what&apos;s causing the bug.

Current WebKit based browsers (as of 3/16/2010), e.g. Safari and Chrome, exhibit the following bugs. Perhaps someone can take a look. Thanks.


Bug 1: If a page A has multiple form elements F1 and F2, and the first (in order of appearance in HTML) form, F1, has autocomplete set to &quot;off&quot; (i.e. &lt;form ... autocomplete=&quot;off&quot;&gt;), but F2 has autocomplete set to &quot;on&quot; (default behavior), then after navigating away from page A, and then hitting browser back button to go back to page A, F1 and F2 may be auto-completed incorrectly. In particular, if F1 and F2 both have input elements with the same name and type, say N and T (i.e. &lt;input name=&quot;N&quot; type=&quot;T&quot; ...&gt;), then when navigating back to page A using the back button, F1.N&apos;s value will be autocompleted with F2.N&apos;s value. 

Bug 2: First, browser hits page A, and server returns an HTML page with form elements F1 and F2 (both forms have autocomplete set to on). Then, user navigates away from page A, and subsequently returns to page A using the browser back button. On the second visits to page A, WebKit issues another request for A to the server (this differs from FireFox&apos;s behavior, where on back button no addition request is issued to server). If the server returns a different HTML page (e.g. because user session has logged out), with form elements F3 and F4 that are different from F1 and F2, but consisting of input elements with the same name and type, then F3 and F4 will be autocompleted with F1 and F2 input element values, even for input element type hidden and submit.
 

WORK AROUND

Bug 1: never use autocomplete=&quot;off&quot; unless you have this set for ALL the forms on the same HTML page.

Bug 2: case specific, no good generic solution. We found an acceptable work around by including hidden forms to make sure two versions of page A have similar forms; first version has F1, F2, F3, and second one has F1, F2&apos;, and F3, where F2&apos; is a hidden version of F2. If we don&apos;t include F2&apos;, then the second version of page A is F1, and F3, and F3 will be auto-completed with F2&apos;s element values, even for hidden and submit elements in F3.
 

ANALYSIS of WebKit CODE
 
These two bugs occur in the same part of the code, but can probably be considered as two separate bugs. The code are in WebCore sub-directory of the WebKit code tree.
 

Bug 1: in Document::formElementsState, input elements that have autocomplete turned ON (checked via HTMLInputElement::saveFormControlState), have their states saved in a vector. However, in HTMLFormControlElementWithState::finishParsingChildren, every form element, regardless if autocomplete is ON or OFF, restores state from the aforementioned vector. This results in bug 1.

Bug 1 Fix: this should be a fairly straight-forward fix - finishParsingChildren should not restore state if element has autocomplete turned OFF. 

Disclaimer: I don&apos;t develop on Mac. I only use it and we develop a website. I just browse the WebKit code today. Hence, I have not created or tested a patch.
 

Bug 2. This is much more complex.
 
I assume that in a design decision unrelated to autocomplete, WebKit is designed to re-fetch page A if user is using the back button to go back in history to page A.

(I&apos;d be interested in hearing about this too)
 
Fundamentally, WebKit makes the incorrect assumption that the second fetch of page A results in the same HTML, or at least the same set of forms, as the first fetch. If this is not the case, then the autocomplete logic no longer produces the correct/expected behavior.
 
When WebKit saves state for a page, it calls Document::formElementsState, which simply creates a map of pairs, and puts each input element&apos;s name+type and value pair into the map. If two input elements in two separate forms have the same name and type, both the values are saved.
 
For example, say page A has forms F1 and F2, and F1 has input elements with names a1 and a2, with types t1 and t2, with values v1 and v2 respectively. F2 has input elements with names a3 and a2, with types t1 and t2, and values v3 and v4, respectively. WebKit saves the state of this page as (in JSON notiation)
 
{  &quot;a1,t1&quot; : [ v1 ], &quot;a2,t2&quot; : [ v2, v4 ], &quot;a3,t1&quot; : [ v3 ]  }
 
If user revisits page A using the browser back button, WebKit will try to autocomplete forms on the new version of page A, fetched from the server, using the above state. If the new version of page A has exactly the same forms as the last, then everything works. If not, then WebKit produces incorrect behavior. For example, assume the second time page A is fetched, server returns just one form F3, and F3 has input elements with names a4 and a2, with types t1 and t2, then F3&apos;s a2 element will be populated with v2, saved from the previous page.
 
(Note: actual logic of storing state and recovering state, as used in the code, are slightly different, but the idea is the same)
 
This problem manifests itself on websites when user sessions may expire, and after a session expires, hitting page A may produce slightly different HTML. E.g. may give you a &quot;please login&quot; form, or may give you roughly the same content, but in place of a search user data form on top, a login form appears. In these cases, the visible text input element, hidden input element, and submit input elements may all have their values changed by WebKit.
 
Bug 2 Fix: This is difficult, because WebKit re-fetches page A when user uses the back button. If new version of page A is different from the old version, WebKit cannot easily match a form&apos;s state from old version of the page to some form, if it even exists, on the new version. You can&apos;t realistically require all forms to have the same DOM id, and even if you do, that&apos;s still not entirely correct since DOM ids are required to be unique within a HTML page, but not need to be unique across separate HTML Documents.
 
The only fix I can think of is this: when you save the state from the first time you visit page A, take a MD5 or SHA1 hash of the page, and store that with the input element state. When you go back to page A, only restore state if the MD5 or SHA1 hash is the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205147</commentid>
    <comment_count>8</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-03-28 04:25:53 -0700</bug_when>
    <thetext>*** Bug 31413 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205151</commentid>
    <comment_count>9</comment_count>
      <attachid>51857</attachid>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-03-28 04:41:38 -0700</bug_when>
    <thetext>Created attachment 51857
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205153</commentid>
    <comment_count>10</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-03-28 04:43:50 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Created an attachment (id=51857) [details]
&gt; Proposed patch

I confirmed this patch resolved both scenarios of Comment #6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205430</commentid>
    <comment_count>11</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-29 07:30:23 -0700</bug_when>
    <thetext>Thanks Kent for the patch.

While the patch solves bug 1 reported in comment 7, and it probably solves some of the manifestations of bug 2 from comment 7 as well, it does not address the root of the problem and leaves some scenarios unsolved.

Bug 2 reported in comment 7 is caused by WebKit re-fetching the HTML content of a URL when user hits the back button to reach the said URL, loading up a different HTML content than before, but using the saved form state to re-populate the new, changed HTML content.

The patch attempts to get around this problem by checking the &quot;action&quot; attribute of the form. This helps, but it does not solve this scenario:

1) First time fetching ULR X, the content of X contains a form with action A, with a hidden input element H, with value V_H, and text input element T, with value V_T, and another hidden input element J, with value V_J.

2) User moves from X to page Y, the hit back button to go back to X

3) On second fetching of URL X, due to some other state change (e.g. user &quot;session&quot; expired), the content of X now contains a form with action A, and text input element T, with no value pre-set, and another hidden input element J, with value pre-set to V_J&apos;.

Note that the value of J has changed from V_J to V_J&apos;.

4) WebKit will repopulate the new content of X, with old form values. Based on the logic in the code and the patch, it will change the form value to 
   T  --&gt; V_T  (using old value)
   J --&gt; V_J (using old value)

This in fact is the wrong behavior, because the server may have returned a pre-set value V_J&apos; that meant to take the user to a different action on form submit. 

Yes, this does assume that the CGI target -- the form action, stays the same and the CGI demultiplexes task based on a CGI variable. Whether you agree with this style of design or not, it&apos;s something allowed by the CGI architecture.

Okay, suppose we put in a simple fix. Let&apos;s say that we DO NOT restore form values for &quot;hidden&quot; and &quot;submit&quot; fields. Then that&apos;d solve the above scenario, right?

Not quite. While it means the hidden fields and submit fields are populated correctly, and that&apos;s a big plus, the form values will still be populated wrong. For example, consider the following scenario

1) First time fetching ULR X, the content of X contains a form F1 with action A, with a hidden input element H, with value V_H, and text input element T, with no pre-set value, and text input element R, w/o pre-set value, and another hidden input element J, with value V_J.

2) User enters values V_T and V_R for fields T and R. User moves from X to page Y, the hit back button to go back to X

3) On second fetching of URL X, due to some other state change (e.g. user &quot;session&quot; expired), the content of X now contains a new form F0, appearing before F1, with action A, and text input element T, with no value pre-set, and another hidden input element K, with value pre-set to V_K. Then form F1, un-changed from step 1, shows up in the page.

4) WebKit will repopulate the new content of X, with old form values. Based on the logic in the code and the patch, it will change the form value to 
  
  F0:
   T  --&gt; V_T  (using old value)
   K --&gt; V_K (not changing this value since it&apos;s a hidden element)

  F1:
   T --&gt; ??? (no value to pre-fill)
   R --&gt; V_R (using old value)
   J --&gt; V_J (not changing since it&apos;s a hidden field)

So this is better, in that the forms probably will head to the right controller on the server, but the form values T and R in F1, on the new page, are not filled consistently. Plus, this may break the case when JS changes hidden field values.

The point is, in a form, you have an action A, and a set of CGI fields, and WebKit should either fill in values for ALL of the fields, or NONE of the fields. AND, it should only fill in values if the form has not changed. 

Given that WebKit has decided to refetch URL X when user hits back button, you cannot guarantee that form has not changed, and the server has not changed its intent, unless you compare either 1) the entire HTML content of URL X, or 2) entire HTML content of the form, prior to user/JS actions. E.g. if you take the SHA1 hash of the form HTML content, and use that as your identifier, instead of form action, then you&apos;d solve this problem.

At the least, I propose you also patch the code to NOT fill in values for hidden and submit elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205431</commentid>
    <comment_count>12</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-29 07:36:25 -0700</bug_when>
    <thetext>An addition to the last paragraph of comment 11. I propose that, short of using the content-hash approach to determine if HTML has changed, you patch the code to

1. Not fill in hidden and submit form elements, if the value you want to fill is different from the pre-set value from the HTML, AND

2. Never fill in value for a field of a form, no matter what type of the field is, if there is a hidden or submit form element in the form that failed condition 1.

This is still just a stop-gap measure. The real fix is either NOT reloading page on back button, or determine if HTML for the form has changed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205439</commentid>
    <comment_count>13</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-03-29 07:59:16 -0700</bug_when>
    <thetext>Yeah, I understand my patch doesn&apos;t fix the whole of this issue. But I expect the patch solves many problems.

I already have another patch to disable restoring values for button, hidden, image, reset, and submit.  They are not user-editable, so we don&apos;t need to restore values for them.

Hashing the whole HTML document is not acceptable because loading an HTML document might take long time.  It might be possible to hash each of FORM elements by DOMHASH-like algorithm.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205442</commentid>
    <comment_count>14</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-29 08:11:50 -0700</bug_when>
    <thetext>Kent, 

That&apos;s great (what you mentioned in comment 13). What would be nice is to make sure the 2nd part of comment 12 is also true, which is: if WebKit determined that a hidden field of a form should not have its value filled in, because the value fetched from the HTML is different than the value saved, then WebKit should also NOT fill in any other text field in the form.

With that, if on refetch there is an additional form, or a changed form, the rest of the forms on the page can still be re-filled correctly.

Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205468</commentid>
    <comment_count>15</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-03-29 09:01:54 -0700</bug_when>
    <thetext>Guys,

I can&apos;t even review this patch on its merits of what it does for this bug, because it&apos;s not clear *precisely* what this bug represents.

It&apos;d be a lot easier to follow all of this if we had separate bugs for each *specific* issue Benjie describes. Especially since he likes to be very verbose about all of the issues at once, making it hard to digest.  ;)

This bug can be an umbrella for the broken out issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205489</commentid>
    <comment_count>16</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-29 09:31:58 -0700</bug_when>
    <thetext>Sorry, I can be clearer.

There are two bugs.

1) autocomplete forms should not consume saved state -- this one is solved by Kent&apos;s patch

2) WebKit re-fills values for forms that have been changed by the server -- this one is not solved by Kent&apos;s patch, although the patch improves the behavior and eliminates a set of scenarios.

Comment 11 through 14 are for bug number 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205493</commentid>
    <comment_count>17</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-03-29 09:38:20 -0700</bug_when>
    <thetext>(In reply to comment #16)
&gt; Sorry, I can be clearer.
&gt; 
&gt; There are two bugs.
&gt; 
&gt; 1) autocomplete forms should not consume saved state -- this one is solved by
&gt; Kent&apos;s patch

Great.

&gt; 2) WebKit re-fills values for forms that have been changed by the server --
&gt; this one is not solved by Kent&apos;s patch, although the patch improves the
&gt; behavior and eliminates a set of scenarios.

Please file a second bug for this (and mention it here for posterity).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205498</commentid>
    <comment_count>18</comment_count>
    <who name="OPAL Group Development">service</who>
    <bug_when>2010-03-29 09:45:20 -0700</bug_when>
    <thetext>As one of the posters (in Comment #3) that hit this bug a year ago, we&apos;re still following it as we had to put workarounds in place in our own product.

Something to note on #2 above:  I believe this bug is going to be greatly complicated by Javascript.  While it breaks simply because of the form load with cached values, if Hidden fields are manipulated by JS during page load, things go even screwier.

In our live application, such fields can end up with the correct value, the cached value, or occasionally JS &quot;undefined&quot;, with no rhyme or reason as to when which occurs.  I&apos;ve not been able to isolate that in a simple test case, so I have nothing to add other than the suggestion that the new bug be aware that JS onload events seem to complicate this underlying problem exponentially.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205505</commentid>
    <comment_count>19</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-03-29 10:00:30 -0700</bug_when>
    <thetext>I created bug 36762, to keep track of the FIRST bug, regarding autocomplete forms should not consume saved state. Because most of the discussions here are for the 2nd bug, I think this particular thread/bug number should be about the 2nd bug.

Regarding comment 18 from OPAL: to make sure JS changing hidden/submit field values are properly handled (i.e. they are also restored to the post JS value), I think the best approach would be to get a hash of the form DOM, and use that as an unique identifier for the form. In that case, on re-fetch of a URL, if the form DOM has not changed at all, then its values can be re-filled in. Otherwise, don&apos;t re-fill it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205515</commentid>
    <comment_count>20</comment_count>
      <attachid>51857</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-03-29 10:31:36 -0700</bug_when>
    <thetext>Comment on attachment 51857
Proposed patch

Curious about this issue, I applied the patch.

I might be missing something here, but this test functions the same in a webkit nightly as it does with the patch applied.

Layout tests are supposed to fail before a patch, and pass with it.  What is the actual change in behavior here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>205586</commentid>
    <comment_count>21</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-03-29 11:48:00 -0700</bug_when>
    <thetext>(In reply to comment #20)
&gt; (From update of attachment 51857 [details])
&gt; Curious about this issue, I applied the patch.
&gt; 
&gt; I might be missing something here, but this test functions the same in a webkit
&gt; nightly as it does with the patch applied.
&gt; 
&gt; Layout tests are supposed to fail before a patch, and pass with it.  What is
&gt; the actual change in behavior here?

I realize now that Safari&apos;s forms autofill was stepping in and clouding my results - DRT sees the before and after.  I&apos;ll do a proper review now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>206362</commentid>
    <comment_count>22</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-03-30 22:28:33 -0700</bug_when>
    <thetext>*** Bug 20778 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>207994</commentid>
    <comment_count>23</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-04-02 12:18:09 -0700</bug_when>
    <thetext>* autocomplete=off issue and
* type=hidden issue
has been resolved by r57012 and r57013.  The remaining is the form identification issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208033</commentid>
    <comment_count>24</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-04-02 13:19:36 -0700</bug_when>
    <thetext>I&apos;m planing to implement the &quot;form hash&quot; idea.

- Form control states are saved when a user leaves the page.
- Form control states are restored when the page is parsed.
So, If we introduce the form hash, and if the form DOM is changed after parsing and before leaving (e.g. another control is added to the form by JavaScript), control states won&apos;t be restored.

Is it acceptable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208041</commentid>
    <comment_count>25</comment_count>
    <who name="Beat">brunner</who>
    <bug_when>2010-04-02 13:31:53 -0700</bug_when>
    <thetext>First of all, thanks for fixing the related bug.

Back to your question:

No, don&apos;t think form hashes will work in our case:

In our web-applications (used on a large number of servers), we use hidden fields combined with cookie states and javascript states to efficiently protect forms against spambots.

So typically, the same form re-displayed will have different hidden field values, and auto-fill-in restore from saved state is useful when hitting back button. But if you do DOM hash of form, it will be different. Same for the captcha image where applicable.

So implementing hashing the DOM of FORM will break the extremely useful form restoration on the back button.

That&apos;s if I understand right what you mean by that.

But I might have understood wrongly what you meant by form hash...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208178</commentid>
    <comment_count>26</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-02 17:28:29 -0700</bug_when>
    <thetext>Beat: I believe Kent is talking about taking the hash of the form DOM.

The problem with NOT taking the hash of the form DOM, is that there is no other good way for the browser to know that the form has not changed. Since WebKit&apos;s behavior is on back button, it reloads the page, if the form has changed, then restoring form values will give you the wrong behaviors.

Right now, I can&apos;t come up with any better solution. To me, the acceptable solutions are: 1) use some kind of hash thing to see if the form has changed, or 2) no restore of values unless the page is loaded from cache, and not from server. If the form&apos;s DOM changes and there are different input elements, restoring values will result in a bogus form. 

This may be outside the scope of this particular discussion: but is there a good reason why WebKit refetches page on back button? I figure there must be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208181</commentid>
    <comment_count>27</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-04-02 17:31:58 -0700</bug_when>
    <thetext>(In reply to comment #26)
&gt; This may be outside the scope of this particular discussion: but is there a
&gt; good reason why WebKit refetches page on back button? I figure there must be.

 All browsers refetch pages on back button in some circumstances. They don’t hold all the pages in the entire back/forward list memory. There is an optimization for the back button in some browsers, originally created in Mac Internet Explorer, and in Safari for a long time, and recently introduced in Firefox, where some pages are cached to make the back command even faster.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208277</commentid>
    <comment_count>28</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-04-03 07:37:30 -0700</bug_when>
    <thetext>(In reply to comment #25)
&gt; No, don&apos;t think form hashes will work in our case:

My current plan is that the form hash is a hash value of the following information:

* form/@action, form/@method, form/@enctype
* for each of form controls
  - @type
  - @name

and it doesn&apos;t contain other attributes of &lt;input&gt; including @value, text nodes, non-control elements.
So, the following A and B will be equivalent, but C won&apos;t be equivalent with others.
Does this make sense?

A:
&lt;form action=&quot;foo.cgi&quot; id=form1&gt;
 &lt;input type=hidden value=session12345&gt;
 Username: &lt;input type=text name=user&gt;
 Password: &lt;input type=password name=password&gt;
&lt;/form&gt;

B:
&lt;form action=&quot;foo.cgi&quot; id=form2&gt;
 &lt;input type=hidden value=session98765&gt;
 Your name: &lt;input type=text name=user&gt;
 PIN: &lt;input type=password name=password&gt;
&lt;/form&gt;

C:
&lt;form action=&quot;foo.cgi&quot; id=form1&gt;
 &lt;input type=hidden value=session4567&gt;
 Username: &lt;input type=text name=user&gt;
 Password: &lt;input type=password name=password&gt;
 &lt;input type=checkbox name=remember&gt;Remember me.
&lt;/form&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208286</commentid>
    <comment_count>29</comment_count>
    <who name="Beat">brunner</who>
    <bug_when>2010-04-03 10:32:31 -0700</bug_when>
    <thetext>In our forms, we vary names of security-related hidden inputs as well, not only value, to make things particularly difficult for spambots...keeping things in sync with server-side sessions. I know that popular CMS systems like joomla do that too.

I guess if the form hash ignores all values and completely all hidden inputs, but concentrates just on names and type of visible input elements it can make sense. It&apos;s anyway only the visible input elements (except password fields and now except hidden fields as well) which now get restored.

Obviously, cases where a form has optional inputs which are there or not depending on state will not be restored properly with such a form hash...don&apos;t have a solution here.

The form fields restore feature of webkit on back button is awesome and has been a lifesaver in many cases for me. It&apos;s actually one of the top 3 features making it my favorite browser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208289</commentid>
    <comment_count>30</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-03 11:37:44 -0700</bug_when>
    <thetext>Kent, 

Thanks for the update on your plan.

There is a problem with what you described, not including @value. Any CGI infrastructure where the action depends on the value of a hidden CGI variable, will be broken when user hits back button.

Consider this: form A on page X, when user is logged in, has CGI variable named action, value set to &quot;add&quot;. User goes from X to next page, user session times out, hits back button, lands on page X, but form A is replaced by server with form B: with CGI variable named action, value set to &quot;login&quot;.  But WebKit would replace the value from &quot;login&quot; to &quot;add&quot;.

If you are not going to take the hash of the entire form, you should at least include hidden values in the hash. 

I wonder if there&apos;s a different way to consider this problem. We&apos;ve been struggling with what&apos;s the best solution if the page is reloaded. No matter what we are guessing what the server&apos;s intention is.

Perhaps there should be two separate behaviors. First, if when user hits the back button, WebKit does NOT reload the page, but instead loads the page from cache, and also does not fire off JS again, then you can auto-fill forms using exactly the same technique as implemented in the existing code base.

Second, if when user hits the back button, WebKit does RELOAD from server, then after loading the page, any JS hooks will fire off as well. In this case, we shouldn&apos;t worry about things like hidden values and type=submit input element values. In fact, in this case, perhaps the auto-fill should ONLY handle values that users can type. So in this case, what Kent proposed would work, if augmented with not changing values of any input element that the user cannot enter via keyboard.

Does that make sense at all?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208290</commentid>
    <comment_count>31</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-03 11:41:15 -0700</bug_when>
    <thetext>The reason I broke up the solution into two separate cases is to handle weather Javascript is fired off again on back button. If JS is NOT fired off because page is loaded from cache, then you have to restore hidden and submit type values. Because those can be changed by JS. If JS is fired because page is loaded from server, then only user entered values should be restored, IMHO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208291</commentid>
    <comment_count>32</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-03 11:45:08 -0700</bug_when>
    <thetext>I apologize, this is the last comment -- I want to clarify comment 30, option 2: what I think would work is Kent&apos;s solution, but hash has to include hidden CGI names AND values, and basically name and values of all input elements that users cannot enter text for. So if hidden field name OR value changed, then autofill should NOT occur.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208336</commentid>
    <comment_count>33</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-04-03 23:32:58 -0700</bug_when>
    <thetext>Why are we inventing this form hash technique? No other browser has it, that I know of. Can we figure out what the behavior of other browsers is, please? We will have to construct tests carefully to avoid being confused by the back/forward caching feature. We need to know the behavior when a back/forward cache is not involved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>208357</commentid>
    <comment_count>34</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-04 06:36:17 -0700</bug_when>
    <thetext>Darin,

Good point. May be we don&apos;t need the hash, if we don&apos;t refill values when user hits back button, and the page is reloaded from server instead from cache.

This is the behavior on Firefox. If on back button, the page loaded from cache, values are filled in, and there&apos;s no danger of form confusion. If the page is loaded from the server, then FireFox does not fill in values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211592</commentid>
    <comment_count>35</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-04-12 06:45:46 -0700</bug_when>
    <thetext>(In reply to comment #33)
&gt; Why are we inventing this form hash technique? No other browser has it, that I
&gt; know of. Can we figure out what the behavior of other browsers is, please? We
&gt; will have to construct tests carefully to avoid being confused by the
&gt; back/forward caching feature. We need to know the behavior when a back/forward
&gt; cache is not involved.

I investigated Firefox.
Summary: Firefox has a similar issue.  But it rarely make a problem because Firefox has page cache.

I couldn&apos;t find a way to avoid page cache of Firefox, so confirmed the issue with another way.
1. Change a startup configuration to &quot;When Firefox starts: Show my windows and tabs from last time&quot;
2. Open a local HTML file with two forms, and fill some values
3. Close Firefox
4. Edit the local HTML.  e.g. exchange the location of two forms
5. Start Firefox again

Then, we can see incorrectly filled forms.

I looked the source code of Firefox.  It identifies target controls by id attribute or simple XPath expressions with name attribute value and ordinal number.

(In reply to comment #34)
&gt; Good point. May be we don&apos;t need the hash, if we don&apos;t refill values when user
&gt; hits back button, and the page is reloaded from server instead from cache.

Chromium has no page cache at this moment.  I&apos;m afraid removing this refill feature makes users unhappy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211599</commentid>
    <comment_count>36</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-12 07:14:51 -0700</bug_when>
    <thetext>Kent, 

Thanks for the investigative work.

Is it possible then to change the goal of the autofill system? Currently the goal is to restore the entire state of the form elements, including elements users cannot see. What if the autofill&apos;s goal is to aid users such that they don&apos;t have to re-type data. In that case, we can fulfill the goal by just restoring user enterable text, and not change hidden element values.

Then it&apos;s up to the user to figure out what&apos;s right and wrong; at least we won&apos;t change any hidden or submit element values, in such a way that changes the server&apos;s intention and confuses the user.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211606</commentid>
    <comment_count>37</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-04-12 08:02:47 -0700</bug_when>
    <thetext>&gt; But it rarely make a problem because Firefox has page cache.

Why do you keep saying this? Safari also has a page cache, and as Darin explained above, we had it even before Firefox did.

&gt; I couldn&apos;t find a way to avoid page cache of Firefox

Please see &lt;https://developer.mozilla.org/En/Using_Firefox_1.5_caching&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211627</commentid>
    <comment_count>38</comment_count>
    <who name="">benjie</who>
    <bug_when>2010-04-12 08:59:20 -0700</bug_when>
    <thetext>Alexey,

It doesn&apos;t matter Safari has a page cache or not, but rather, is page cache used when user hits back button, to go back to a page with a form.

In FF, for my test pages (and it seems like for Kent&apos;s as well), more often than not, hitting back button to go back to a page with a form results in FF loading that page from page cache. On Safari, the page is reloaded from the server.

When it&apos;s reloaded from the server, we get the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211630</commentid>
    <comment_count>39</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-04-12 09:03:02 -0700</bug_when>
    <thetext>(In reply to comment #38)
&gt; Alexey,
&gt; 
&gt; It doesn&apos;t matter Safari has a page cache or not, but rather, is page cache
&gt; used when user hits back button, to go back to a page with a form.
&gt; 
&gt; In FF, for my test pages (and it seems like for Kent&apos;s as well), more often
&gt; than not, hitting back button to go back to a page with a form results in FF
&gt; loading that page from page cache. On Safari, the page is reloaded from the
&gt; server.
&gt; 
&gt; When it&apos;s reloaded from the server, we get the bug.

I think Alexey&apos;s point is that:
1 - There&apos;s well known, published ways to avoid Firefox&apos;s Page Cache
2 - In the wild (not with specialized test cases), many form-heavy sites *DO* avoid the page cache in every major browser with the simple step of having an unload handler.

So, yes - this is a real-world problem in Firefox as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211636</commentid>
    <comment_count>40</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-04-12 09:18:58 -0700</bug_when>
    <thetext>The code that decides whether a frame can be cached is in FrameLoader::canCachePage(). Forms do not prevent caching, as far as I can tell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>211642</commentid>
    <comment_count>41</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-04-12 09:51:13 -0700</bug_when>
    <thetext>(In reply to comment #40)
&gt; The code that decides whether a frame can be cached is in
&gt; FrameLoader::canCachePage(). Forms do not prevent caching, as far as I can
&gt; tell.

Correct, we *definitely* cache pages with forms.  Looking at the attached test case, I don&apos;t see anything that would make it not page-cache worthy.

For the purposes of making &quot;autocomplete=off&quot; be a security feature, we also happen to clear certain form values, even in the page cache case.  But I don&apos;t *THINK* we do any restoring.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>216732</commentid>
    <comment_count>42</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-04-24 09:44:55 -0700</bug_when>
    <thetext>(In reply to comment #37)
&gt; &gt; I couldn&apos;t find a way to avoid page cache of Firefox
&gt; 
&gt; Please see &lt;https://developer.mozilla.org/En/Using_Firefox_1.5_caching&gt;.

Thank you for the information.
I tested Firefox behavior without the page cache, and confirmed that the behavior was the same as Comment #35, Firefox filled values to a wrong form.


Internet Explorer 8:
* Without the form completion feature
 When IE fetches a page from a server by the Back button, form values are not restored.
* With the form completion feature
 If a refetched page is different from the original page, IE doesn&apos;t restore form values. I guess IE checks a digest value or something of the HTML.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342608</commentid>
    <comment_count>43</comment_count>
    <who name="Galen Hollins">ghollins</who>
    <bug_when>2011-01-31 09:23:27 -0800</bug_when>
    <thetext>I&apos;ve seen this problem as well in my application.

Here is a simple test case to reproduce in Safari/Chrome.

http://jsfiddle.net/rwaldron/UvmDv/7/ 

I am concerned that this bug has an importance of &quot;Normal&quot;.  This bug has caused data corruption in one of my apps (via the back, then resubmit pattern), and therefore I think this problem should be classified as &quot;Major&quot;.   If it was merely a view-layer problem, things would be different, but this bug actually changes form fields, that in many cases may get resubmitted.

Thanks,
Galen</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>342612</commentid>
    <comment_count>44</comment_count>
    <who name="Galen Hollins">ghollins</who>
    <bug_when>2011-01-31 09:24:21 -0800</bug_when>
    <thetext>*** Bug 53312 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>391625</commentid>
    <comment_count>45</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-04-24 13:19:16 -0700</bug_when>
    <thetext>I have thought how to resolve this issue for one year.  My current thought is below:


What is this feature?
  The purpose of the feature is to restore user-input values without on-memory back-forward cache.
   -&gt; So, we should not restore values for non user-editable controls such as elements with no renderer, visibility:none style, read-only/disabled elements.
   -&gt; We should restore for controls with autocomplete=off because users can edit them.
   -&gt; WebKit should fire &apos;change&apos; events when values are restored because restoring is a kind of user-input.
 
What&apos;s wrong with the current implementation?
  * Values are restored to unexpected controls.
    This often happens for dynamically generated pages.
    -&gt; We should check page identity more strictly.  Currently we have queues for type-name pairs.  We should have stricter data structure such as a list of type-name.

  * Values are restored to dynamically-generated controls.
    If the restore value queue is not empty and a dynamically-generated control accidentally match to a type-name pair in the queue, the control has the restored value.
    -&gt; We should restore values only once, and purge unused saved values just after that.
        IMO, we should restore values just after document&apos;s &apos;load&apos; event because the &apos;load&apos; event is often used to build a page.  If we change so, we won&apos;t restore values for controls added after the &apos;load&apos; event. 


Comments?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>391632</commentid>
    <comment_count>46</comment_count>
    <who name="Darth">priyajeet.hora</who>
    <bug_when>2011-04-24 13:36:58 -0700</bug_when>
    <thetext>&gt; WebKit should fire &apos;change&apos; events when values are restored because restoring is a kind of user-input.

What if the change event caused a page refresh or navigation?
Say I have a form with some drop down to choose some item, and some particular item on choose causes a page navigation since its a new workflow, wont&apos; pressing back on the browser cause an issue?

Another question, will there be any difference in what is done on https vs https pages? What about pages declaring no-cache / no-store etc? thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>391644</commentid>
    <comment_count>47</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2011-04-24 14:45:31 -0700</bug_when>
    <thetext>(In reply to comment #46)
&gt; &gt; WebKit should fire &apos;change&apos; events when values are restored because restoring is a kind of user-input.
&gt; 
&gt; What if the change event caused a page refresh or navigation?
&gt; Say I have a form with some drop down to choose some item, and some particular item on choose causes a page navigation since its a new workflow, wont&apos; pressing back on the browser cause an issue?

Good point.
We should dispatch the change event anyway because updating page structure by checking/unchecking checkboxes or radio buttons is a typical usage.  So we would disable navigation during restoring control values.

&gt; Another question, will there be any difference in what is done on https vs https pages? What about pages declaring no-cache / no-store etc? thanks

I don&apos;t think they matter.  I have never seen complaints with them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>643906</commentid>
    <comment_count>48</comment_count>
    <who name="Darth">priyajeet.hora</who>
    <bug_when>2012-06-07 14:23:51 -0700</bug_when>
    <thetext>Another issue recently I encountered, but seems more of a regression in Chrome at least as Safari seems consistently broken.

http://code.google.com/p/chromium/issues/detail?id=131645</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>643968</commentid>
    <comment_count>49</comment_count>
    <who name="Darth">priyajeet.hora</who>
    <bug_when>2012-06-07 15:12:46 -0700</bug_when>
    <thetext>(In reply to comment #48)
&gt; Another issue recently I encountered, but seems more of a regression in Chrome at least as Safari seems consistently broken.
&gt; 
&gt; http://code.google.com/p/chromium/issues/detail?id=131645

I found a Safari 5.1.3 machine, and issue doesnt happen on that, so my prior statement suggesting all Safari&apos;s show this issue is incorrect. Safari 5.1.5 does show the issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>658633</commentid>
    <comment_count>50</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2012-06-27 08:41:27 -0700</bug_when>
    <thetext>(In reply to comment #47)
&gt; (In reply to comment #46)
&gt; &gt; Another question, will there be any difference in what is done on https vs https pages? What about pages declaring no-cache / no-store etc? thanks
&gt; 
&gt; I don&apos;t think they matter.  I have never seen complaints with them.

I&apos;m not quite sure what you&apos;re saying.

Maybe what you&apos;re saying is &quot;I&apos;ve never seen WebKit users complain about those sites behaving differently,&quot; in which case I have nothing to add.

But if you&apos;re saying &quot;I have never seen those sites complain about form restoring, so we&apos;ll treat them the same as any other site,&quot; then I must take pause.

They do matter.  The code is in there for a reason.  We&apos;d much rather *not* see major U.S. and International banks disable working in WebKit browsers, for example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>676420</commentid>
    <comment_count>51</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-07-23 23:17:02 -0700</bug_when>
    <thetext>(In reply to comment #50)
&gt; &gt; &gt; Another question, will there be any difference in what is done on https vs https pages? What about pages declaring no-cache / no-store etc? thanks
&gt; &gt; 
&gt; &gt; I don&apos;t think they matter.  I have never seen complaints with them.
&gt; 
&gt; I&apos;m not quite sure what you&apos;re saying.

I meant we didn&apos;t need to change the current WebKit behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>676422</commentid>
    <comment_count>52</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-07-23 23:24:23 -0700</bug_when>
    <thetext>I made a major improvement of the feature recently, and I believe the restore feature is not bad now.  I&apos;m closing this bug. If someone still have a problem, please file another bug and cc to me.

(In reply to comment #45)
&gt; What is this feature?
&gt;   The purpose of the feature is to restore user-input values without on-memory back-forward cache.
&gt;    -&gt; So, we should not restore values for non user-editable controls such as elements with no renderer, visibility:none style, read-only/disabled elements.

I didn&apos;t change this behavior. We saves almost all of form control values, including type=hidden.

&gt;    -&gt; We should restore for controls with autocomplete=off because users can edit them.

I don&apos;t change this behavior yet.

&gt;    -&gt; WebKit should fire &apos;change&apos; events when values are restored because restoring is a kind of user-input.

I didn&apos;t do it. Because we restore form control state only during document parsing, and I&apos;m not sure dispatching event would make sense in such case.

&gt; What&apos;s wrong with the current implementation?
&gt;   * Values are restored to unexpected controls.
&gt;     This often happens for dynamically generated pages.
&gt;     -&gt; We should check page identity more strictly.  Currently we have queues for type-name pairs.  We should have stricter data structure such as a list of type-name.

Done.  We identify forms with form structure.

&gt;   * Values are restored to dynamically-generated controls.

When we switched to HTML5 parser, this behavior was gone, and no one requested to fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>719693</commentid>
    <comment_count>53</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-09-13 11:11:06 -0700</bug_when>
    <thetext>*** Bug 96589 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>50802</attachid>
            <date>2010-03-16 09:43:24 -0700</date>
            <delta_ts>2010-03-16 09:43:24 -0700</delta_ts>
            <desc>HTML files showing the bug</desc>
            <filename>bug.tgz</filename>
            <type>application/octet-stream</type>
            <size>523</size>
            <attacher>benjie</attacher>
            
              <data encoding="base64">H4sIAOC0n0sAA+2WzW6cMBSFWfMUljfZBRsYkBKgi1ZZVpXyAJUBM7gFG4GpmLevGQb6M5oJjTRE
qe4nITAcsDlwj+5Avqb9/r7UdWXdCmIIfP+4D4PdcU/caWyg1HctSj0/DN1wRz2LUNfdhRYiN1vR
b/SdZi1CVsrlN8Ev64ysKLZY0LY8ibbTqFBt/WBHjZPYdjQOEMu0UDLGzh6jTh8qHuOatXshH0gz
YBsp2fVpLXSMK5WxUXtftryI7w7Hf+nuseW6byUqWNXxR5zYkZBNr5E+NOZRpchzLjGSrDYjhtEP
VvXjEcXOVanIF60812o+6FmpF6Gmf08/LX1WzqOTfHLkaTThebpi7nZGUxJk3GkS+5lnSuazaU6z
mFZzXao8xo3qzPNmCz9gJMzJtGLlah9cbCZb6cO59oIP7j/5cHrLa0ZEDP3x0ZPPZmLUsD2PHJac
rHnrPxy4xkDfPP+JvyO/8t+lx/wPCOT/FrwqzyDF/huG25f/i/0f8Zf694nnj/VPA+j/NuFS/3ex
lWG9Vpmqm4prHquiWN/Zrc+Cc+3Kzm4q/kl3Op6kU+kvlf/KPu4d5d5HJQsx9vHmBT/x8WNB7gHn
HG6c/SMv9X/EDef8pwF1Tf5Tzwsg/7fgS8VZx1FvtpRl31Haa60klD0AAAAAAAAAAAAAAAAAAMB7
5ydcPuv2ACgAAA==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>51857</attachid>
            <date>2010-03-28 04:41:38 -0700</date>
            <delta_ts>2010-06-11 11:36:43 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bug-23346-20100328204136.patch</filename>
            <type>text/plain</type>
            <size>15207</size>
            <attacher name="Kent Tamura">tkent</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0xheW91dFRlc3RzL0NoYW5nZUxvZyBiL0xheW91dFRlc3RzL0NoYW5nZUx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VtcG9yYXJ5Rm9ybUZvcklzSW5kZXgo
KTsKICAgICAvLyBIZWxwZXIgZm9yIGdldEFsbG93ZWRWYWx1ZVN0ZXAoKTsK
</data>
<flag name="review"
          id="35212"
          type_id="1"
          status="-"
          setter="beidson"
    />
          </attachment>
      

    </bug>

</bugzilla>