Last Comment Bug 394782 - Radio buttons change on refresh
: Radio buttons change on refresh
Status: RESOLVED WORKSFORME
DUPEME
: regression
Product: Core
Classification: Components
Component: Layout: Form Controls (show other bugs)
: unspecified
: All All
: -- major with 19 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
http://www.marcreichelt.de/misc/firef...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-03 12:32 PDT by Marc Reichelt
Modified: 2016-04-06 09:40 PDT (History)
17 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Reduced testcase for reference (832 bytes, text/html)
2009-06-02 16:41 PDT, Elvis Pranskevichus
no flags Details

Description Marc Reichelt 2007-09-03 12:32:51 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5

When loading, the yes/no radio buttons on http://www.marcreichelt.de/misc/emff0.5/ show the correct status (the "no" radio buttons are selected).
After reloading with F5, the radio buttons change their state (the JavaScript on this site leaves the radio buttons untouched).

Reproducible: Always

Steps to Reproduce:
1. Start Firefox.
2. Load http://www.marcreichelt.de/misc/emff0.5/ into your browser.
3. Press F5 and notice that the radio buttons have changed.
Actual Results:  
The radio buttons change their state.

Expected Results:  
The radio buttons should not change their state.

The bug also happens on Windows.
Comment 1 Ria Klaassen (not reading all bugmail) 2007-09-03 13:34:09 PDT
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a8pre) Gecko/2007090222 Minefield/3.0a8pre

Yeah, I see this too. With the Flashblock extension installed I don't see the problem.
Comment 2 Ria Klaassen (not reading all bugmail) 2007-09-03 14:14:05 PDT
It is a regression somewhere in the last quarter of 2004.
Comment 3 Marc Reichelt 2007-09-07 05:38:18 PDT
(In reply to comment #0)
I now moved the experimental site to http://www.marcreichelt.de/misc/firefox/bug394782/ (for better testing purpose) and removed lot of JavaScript code there.
The error seems to occur if a flash object is dynamically showed using Node.innerHTML (see line #47 on http://www.marcreichelt.de/misc/firefox/bug394782/codegenerator.js).

Can somebody see what the problem here is?
Comment 4 Sam Moffatt 2007-09-30 05:19:01 PDT
Joomla! has a bug for this in our tracker as well:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=4711

The issue cannot be replicated in any other browser except for Firefox. It appears to be related to an issue with radio button. Whilst I wasn't able to produce some simple sample code to get the refresh to change the selected button, I was able to generate some simple sample code that shows that the radio button state isn't being set properly on a page refresh.

Steps to reproduce:
1) Create a simple HTML document with a set of radio buttons without any marked as checked. The Joomla! tracker has some sample code.
2) Load up in Firefox. The correct state should be shown.
3) Update the text file and change/set the checked value and also update some text on the page
4) Refresh in the same tab/window of Firefox. The radio button won't change state however the text will update.
5) Open a new window/tab and load the page. The page renders appropriately.

Tested platforms:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-GB; rv:1.8.1.7) Gecko/2007091417 Firefox/2.0.0.7
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/2007073113 Firefox/2.0.0.6 (Ubuntu-feisty)
Comment 5 Sam Moffatt 2009-04-28 04:38:24 PDT
This is still an issue using the following: http://www.marcreichelt.de/misc/firefox/bug394782/

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3
Comment 6 Martin Creutziger [:MMx] 2009-04-28 06:53:27 PDT
yes, and also still an issue using the following builds:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b5pre) Gecko/20090427 SeaMonkey/2.0b1pre
Mozilla/5.0 (Windows; U; WindowsNT 5.1; en-US; rv:1.9.1b4) Gecko/20090423 Firefox/3.5b4

Confirming & reassigning - maybe someone who knows the issue better can take a look at it.

Marc: Do you know when exactly the regression happened?
Comment 7 Marc Reichelt 2009-04-28 08:53:22 PDT
Martin: I don't know when this regression happened exactly, and in the moment I am unable to test this. I will set up Ubuntu 9.04 in VirtualBox and will test some old nightly builds if I get the time to.
Comment 8 Boris Zbarsky [:bz] (still a bit busy) 2009-04-28 11:37:58 PDT
This regressed between 2004-10-31-07 and 2004-11-01-07.  Bonsai range: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=MozillaTinderboxAll&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2004-10-31+04&maxdate=2004-11-01+10&cvsroot=%2Fcvsroot

If the radios are being added via script, this is probably a regression from bug 204784 and almost certainly a dup of the bug on form state restoration being confused on reload if the button order at page unload doesn't match that on page parse.
Comment 9 Elvis Pranskevichus 2009-06-02 15:32:21 PDT
Ryan Cramer discusses the issue here: http://www.ryancramer.com/journal/entries/radio_buttons_firefox/.  Also, he has a very simple test case here: http://www.ryancramer.com/projects/asmselect/examples/autocomplete.html

I've been bit by this issue several times already.
Comment 10 Elvis Pranskevichus 2009-06-02 16:41:53 PDT
Created attachment 381185 [details]
Reduced testcase for reference
Comment 11 Vlad Atanasiu 2009-08-06 06:37:20 PDT
Instead of refreshing the page with F5 or Ctr+R insert the cursor in the address bar, hit the return key and the radio buttons will no longer cycle. Same result when using Shift+Ctrl+R. This might give a hint to where the bug is living.
Comment 12 Vlad Atanasiu 2009-08-06 07:14:23 PDT
(In reply to comment #11)

Vlad, have you read the bug?  In particular comment 8?

Loading via url bar or forced reload does not perform form state 
restoration, so obviously a bug in form state restoration wouldn't be 
observable that way.

-Boris



Boris: 
the workarounds would confirm the issue is in form autocomplete, as you suggested in comment #8.
Vlad
Comment 13 Mark Carver 2010-08-07 02:12:22 PDT
I can confirm this is still an issue. Running 3.6.8 on Mac OS X 10.6.4. I'll admit that I am a little shocked to see that this issue is nearly three years old and still no resolution!

For anyone that needs help developing around this bug, please read:
http://www.ryancramer.com/journal/entries/radio_buttons_firefox/

Granted, the fix isn't perfect, but if necessary it will give you an option.
Comment 14 Roman R. 2011-03-07 23:09:15 PST
This is still a problem in Firefox 4.0b13pre.
Comment 15 Aaron D. Campbell 2011-04-05 07:23:27 PDT
Seems to have popped up in WordPress recently: http://core.trac.wordpress.org/ticket/17051
Comment 16 Ryan 2011-06-15 13:49:12 PDT
Still a problem in 4.0.1.
Comment 17 James 2011-06-17 08:54:34 PDT
Confirmed, still a problem in 4.0.1 on Mac OS X 10.6.7
Comment 18 James 2011-06-17 08:59:20 PDT
@Mark Craver: per your fix from www.ryancramer.com, I was able to prevent the problem by just putting autocomplete="off" on the radio buttons themselves, this way you can still get autocomplete on the other fields
Comment 19 dave 2012-07-18 06:22:43 PDT
Just revisited this bug and noticed that I can't reproduce in the latest version of FF.  I guess it was fixed somewhere along the way.
Comment 20 a.l.e 2012-09-03 08:22:32 PDT
hi dave,

testing http://www.ryancramer.com/projects/asmselect/examples/autocomplete.html : the error shows up with firefox 14.0.1 .
Comment 21 dave 2012-09-03 08:43:04 PDT
My mistake.  I do still see the problem if the initially selected radio button is changed.  (I'm not sure if changing the selected button was necessary to reproduce the problem in the past.  I don't think it was.)
Comment 22 Sam Moffatt 2012-11-17 23:12:42 PST
I just checked and I can reproduce this on Firefox 16 as well. I think you need to select a radio button the first time you go to the page but once you've done that once it disappears.

Roughly steps:
1) Go to ryancramer.com example
2) Refresh the page a few times; this didn't appear to change the selected radio button
3) Click on the second radio button
4) Refresh the page again

At this point the radio button should change which item is selected progressively each refresh.
Comment 23 Justin [:JW_SoftvisionQA] 2016-04-06 09:40:53 PDT
This issue is not present in Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0

I will close this bug as WFM. Please reopen if this issue persists.

Note You need to log in before you can comment on or make changes to this bug.