Closed Bug 465203 Opened 16 years ago Closed 15 years ago

Specific problem in Firefox only due to design choice in bug 46845

Categories

(Core :: DOM: Navigation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: duncan.loveday, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081108 Minefield/3.1b2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b2pre) Gecko/20081108 Minefield/3.1b2pre

After all that's been said - over 200 comments on bug 46845 - I still believe the behaviour of not resetting form fields on page refresh should be changed. The attached is an example where a script works fine in Firefox, Opera, IE7, Safari and Chrome....until you refresh the page in Firefox when it starts failing. The script is specifically written to assume that javascript state and form state are maintained in step. Granted (1) it's a contrived example and (2) web developers can easily avoid making this assumption (e.g. by explicitly resetting form state from scripts run from onload()) and (3) it might be an invalid/unsafe assumption to make etc etc. But on the other hand it does work in everything except Firefox and in this case the arguments about user experience are irrelevant because the form state concerned is hidden.

Reproducible: Always

Steps to Reproduce:
1. Load the attached in various browsers and press the button.
2. Refresh the page and press the button again.
3.
Actual Results:  
In Firefox the script gets an exception when run after the page has been refreshed. This can only be cleared by ctrl-refresh or giving focus to the awesome bar and pressing enter.

Expected Results:  
I'd argue the script should work after refresh as with other browsers.

Perhaps different arguments apply to hidden vs visible form elements.
Attached file HTML test case
We ran into a similar problem with hidden fields and refresh in Firefox - only it didn't take a script to trigger it.

Request a form with POST.  In that form is a hidden field containing state.  This changes with each request - that's why we use POST, after all.

Reload.

The hidden field doesn't update.  IT STAYS THE SAME, DESPITE A NEW POST REQUEST.  Also, note that since it's a hidden field, this is DESPITE the fact that the users has never interacted with this field.

Anyone else but me see a problem with this?  I'm embarrassed for Firefox that the devs are being so stubborn about this behavior, which NO OTHER BROWSER has adopted, with good reason.

I'm adding the comment to this bug, since every other bug I could find has been closed as invalid or duplicate.

The workaround, autocomplete=off on the hidden field, is nice and all, but that's not an XHTML attribute, which limits it's applicability.
I have to agree with the validity of this test.  This bug hurts programmers (forcing extra steps to achieve what would seem to be the default behavior) as well as users (refresh seems to only partially revert the page to its default state).
I had an email conversation with Brendan and Boris who between them persuaded me that this bug is invalid. The test case shows it's possible to write script that breaks when you press reload in Firefox but the thing is any such script can also break in other browsers when using the forward and back buttons. Browsers do sometimes restore form state from cache whilst not guaranteeing javascript state is kept in step.

So writing a script in the way I did for the test case is a programming error. It's just that in Firefox, the error is made more obvious.

As for the UI comments, these have been done to death in bug 46845 and there's no point opening up that debate again here.

=> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: