As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 516920 - Disable dynamically created button causes static button disabled when refreshing
: Disable dynamically created button causes static button disabled when refreshing
Status: RESOLVED WORKSFORME
: regression, testcase
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Andrew Overholt [:overholt]
Mentors:
Depends on: 654072
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-16 02:32 PDT by nanwang
Modified: 2016-06-17 02:10 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
reporter's testcase (284 bytes, text/html)
2009-09-16 06:25 PDT, Ria Klaassen (not reading all bugmail)
no flags Details

Description User image nanwang 2009-09-16 02:32:46 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) 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:

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

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.
Comment 1 User image Ria Klaassen (not reading all bugmail) 2009-09-16 06:22:24 PDT
This bug is reproducible on Windows Vista with latest trunk, not with Firefox 2.
Comment 2 User image Ria Klaassen (not reading all bugmail) 2009-09-16 06:25:40 PDT
Created attachment 401004 [details]
reporter's testcase
Comment 3 User image danielkbx 2009-10-28 09:21:59 PDT
The bug still exists on Firefox 3.5.4 on Windows Vista and OSX.
Comment 4 User image Nickolay_Ponomarev 2011-11-29 13:16:26 PST
If bug 654072 is fixed, we won't attempt to restore the disabled state, so I guess this will be fixed as well.
Comment 5 User image Cosmin Muntean [:CosminMCG] 2016-06-17 02:10:50 PDT
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.

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