Bug 10541

Summary: REGRESSION: The text on a button sometimes shows up as the text of another button on the same page
Product: WebKit Reporter: jonathanjohnsson
Component: FormsAssignee: Maciej Stachowiak <mjs>
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, rachael
Priority: P1 Keywords: InRadar, Regression
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://bugzilla.opendarwin.org/show_bug.cgi?id=10499
Attachments:
Description Flags
Example of the bug in action
none
the fix, made new ListHashSet class and used it mjs: review+

jonathanjohnsson
Reported 2006-08-24 10:52:14 PDT
Look at the text on the buttons of the attached screenshot to understand what I mean. This is the third time I encounter this, the first two times I only noticed that a button contained the wrong text (text from some other button on the same page), but this last also that the text had swapped between two buttons. The first time I noticed it was on zeldman.com, the others here on bugzilla. It happens very seldom, but it feels kind of strange to hit "Find" to commit a change to a bug. I have never seen this in released Safari, so I believe it's a regression.
Attachments
Example of the bug in action (96.07 KB, image/png)
2006-08-24 10:53 PDT, jonathanjohnsson
no flags
the fix, made new ListHashSet class and used it (27.82 KB, patch)
2007-01-31 04:33 PST, Maciej Stachowiak
mjs: review+
jonathanjohnsson
Comment 1 2006-08-24 10:53:10 PDT
Created attachment 10203 [details] Example of the bug in action
mitz
Comment 2 2006-10-11 05:37:47 PDT
Got this a couple of times today following some back/forward cache navigation including non-HTML documents. Looks like a problem with restoring form state in these cases. Vaguely reminiscent of bug 8753.
Rachael Worthington (cheers)
Comment 3 2006-10-11 10:53:21 PDT
I see this occasionally when logging into omni's phpbb forums (forums.omnigroup.com), although I haven't figured out exactly what the trick is to get it to happen. the post-logged in screen has a button that says "if you're not redirected click here" and the button sometimes reads "submit" instead of "proceed".
John Sullivan
Comment 4 2006-10-27 15:05:59 PDT
This is in radar as 4751164.
mitz
Comment 5 2006-11-15 03:43:16 PST
I have a fairly reproducible case here: https://svn.macosforge.org/projects/webkit/wiki/WebKit%20Team?action=history After you click the "View changes" button and navigate back, that button's title changes to Search and the radio buttons change state.
mitz
Comment 6 2006-11-17 14:32:23 PST
I think the problem is that Document's m_formElementsWithState is a hash set, and as such its iterator is undeterministic. This makes the order in the result of Document::formElementsState() arbitrary for same-named, same-typed controls, so it doesn't necessarily match registration order. Radio buttons are especially susceptible since typically there are multiple radio buttons with the same name. They have unique values, but value isn't part of the saved state for radio buttons!
Maciej Stachowiak
Comment 7 2007-01-31 04:33:30 PST
Created attachment 12820 [details] the fix, made new ListHashSet class and used it
Maciej Stachowiak
Comment 8 2007-01-31 05:58:10 PST
Comment on attachment 12820 [details] the fix, made new ListHashSet class and used it Mark reviewed this, with bonus review help from Lars for the natty template bits.
Note You need to log in before you can comment on or make changes to this bug.