Disable dynamically created button causes static button disabled when refreshing




8 years ago
2 months ago


(Reporter: nanwang, Unassigned)


(Depends on: 1 bug, {regression, testcase})

Windows XP
regression, testcase

Firefox Tracking Flags

(Not tracked)



(1 attachment)



8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090824 Firefox/3.5.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090824 Firefox/3.5.3

Creating a disabled button element dynamically using javascript in HTML, and click "Refresh" on the page, it causes another static button disabled unexpectedly. Please refer to the simplified HTML sample in the Steps to Reproduce section.

Reproducible: Always

Steps to Reproduce:
1. Save the following simplified HTML as a file and open it by Firefox.
2. Click "Refresh" button on the toolbar of Firefox.

Sample HTML:

<div id='d'></div>
<script type='text/javascript'>
	var btn = document.createElement('button');
	btn.disabled = true;
	btn.innerHTML = "dynamic";

Actual Results:  
Both buttons are disabled after Step 2.

Expected Results:  
The static button is enabled and the dynamic button is disabled.

We have been fighting against this issue for whole day long and eventually we think it's a bug in Firefox. This happens only when you click the "Refresh" button of Firefox. Pressing Enter within the URL field refreshes the whole page and there's no such problem.

This issue has caused severe problem for our project and we need to forfeit a whole solution. Feedback are welcome.

We can reproduce the problem with the latest Firefox 3.5.3, as well as 3.0.13 and 3.0.14, on windows XP.
This bug is reproducible on Windows Vista with latest trunk, not with Firefox 2.
Component: General → DOM
Ever confirmed: true
Keywords: regression, testcase
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Created attachment 401004 [details]
reporter's testcase

Comment 3

8 years ago
The bug still exists on Firefox 3.5.4 on Windows Vista and OSX.

Comment 4

6 years ago
If bug 654072 is fixed, we won't attempt to restore the disabled state, so I guess this will be fixed as well.
Depends on: 654072
Firefox, 50.0a1, Build ID  20160616030228
User Agent  Mozilla/5.0 (Windows NT 5.1; rv:50.0) Gecko/20100101 Firefox/50.0

I have tested this issue on the latest Firefox (47.0) release and latest Nightly (50.0a1) build and is no longer reproducible. I have opened the provided test case and after page refresh the "dynamic" button is disabled and the "static" button is active.
I can confirm that this issue is reproducible on a older version of Firefox (3.5). After page refresh the both buttons are disabled. 

Considering this, I will mark this as Resolved-Worksforme. If anyone can still reproduce it, feel free to reopen the issue and provide more information.
Last Resolved: a year ago
Resolution: --- → WORKSFORME

Comment 6

2 months ago
I am glad that this bug is now fixed because it was directly or indirectly affecting many websites like youtube.com, https://snapchatonlinelogin.org
You need to log in before you can comment on or make changes to this bug.