Bug 10541 - REGRESSION: The text on a button sometimes shows up as the text of another button on the same page
Summary: REGRESSION: The text on a button sometimes shows up as the text of another bu...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Maciej Stachowiak
URL: http://bugzilla.opendarwin.org/show_b...
Keywords: InRadar, Regression
Depends on:
Reported: 2006-08-24 10:52 PDT by jonathanjohnsson
Modified: 2007-01-31 06:03 PST (History)
2 users (show)

See Also:

Example of the bug in action (96.07 KB, image/png)
2006-08-24 10:53 PDT, jonathanjohnsson
no flags Details
the fix, made new ListHashSet class and used it (27.82 KB, patch)
2007-01-31 04:33 PST, Maciej Stachowiak
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jonathanjohnsson 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.
Comment 1 jonathanjohnsson 2006-08-24 10:53:10 PDT
Created attachment 10203 [details]
Example of the bug in action
Comment 2 mitz 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.
Comment 3 Rachael Worthington (cheers) 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".
Comment 4 John Sullivan 2006-10-27 15:05:59 PDT
This is in radar as 4751164.
Comment 5 mitz 2006-11-15 03:43:16 PST
I have a fairly reproducible case here:
After you click the "View changes" button and navigate back, that button's title changes to Search and the radio buttons change state.
Comment 6 mitz 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!
Comment 7 Maciej Stachowiak 2007-01-31 04:33:30 PST
Created attachment 12820 [details]
the fix, made new ListHashSet class and used it
Comment 8 Maciej Stachowiak 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.