All events are blocked on disabled form elements but some shouldn't be

RESOLVED DUPLICATE of bug 329509

Status

()

Core
DOM: Events
RESOLVED DUPLICATE of bug 329509
8 years ago
8 years ago

People

(Reporter: miker, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [firebug-p2])

Attachments

(1 attachment)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5

I have noticed that Firefox blocks all events from being raised by disabled elements. Of course most events should be blocked but the following events are harmless in this context and should be allowed:
- mousemove
- contextmenu
- DOMNodeInserted
- DOMNodeRemoved
- DOMAttrModified

One event listed in http://mxr.mozilla.org/mozilla1.9.2/source/content/events/src/nsDOMEvent.cpp#59 may also need to be added but it appears to be undocumented:
- text

Open the attachment and follow the instructions:

1. Move the mouse around the screen and the mouse co-ordinates are updated ... now move the mouse over the disabled button. The mousemove event is blocked so the document never receives it and the co-ordinates are not updated. mousemove is the only way to continually track the mouse position and should not be blocked.

2. Click DOMAttrModified - this changes the text on the disabled button ... the DOMAttrModified event should be raised but it is not.

3. Click DOMNodeRemoved - this removes the disabled button from the document ... the DOMAttrModified event should be raised but it is not.

Refresh the page, click "Enable Button" and repeat steps 1 - 3 ... with the button enabled the appropriate events are fired. 

Reproducible: Always

Steps to Reproduce:
Open the attachment and follow the instructions:

1. Move the mouse around the screen and the mouse co-ordinates are updated ... now move the mouse over the disabled button. The mousemove event is blocked so the document never receives it and the co-ordinates are not updated. mousemove is the only way to continually track the mouse position and should not be blocked.

2. Click DOMAttrModified - this changes the text on the disabled button ... the DOMAttrModified event should be raised but it is not.

3. Click DOMNodeRemoved - this removes the disabled button from the document ... the DOMAttrModified event should be raised but it is not.

Refresh the page, click "Enable Button" and repeat steps 1 - 3 ... with the button enabled the appropriate events are fired. 
Actual Results:  
The events should be raised.

Expected Results:  
the events are not raised.

This causes issued when trying to interact with disabled elements, specifically in the DOM Inspector and Firebug's inspect feature.

This is the root cause of the following bug reports:
- Bug 257623 -  DOM Inspector: "Select Element By Click" does not work for disabled form elements  
- Bug 436770 -  title or alt tooltips are not visible for disabled textbox  
- Bug 297979 -  Cannot right-click on disabled button/input/optgroup/select/textarea form elements
- Bug 218093 -  disabled child element doesn't produce mouseout/mouseover pair
- Bug 497805 -  Title attribute is ignored when form element is disabled  
- Bug 274626 -  Disabled form controls (buttons, inputs) don't show title tooltip attribute
- Bug 486863 -  When a disabled form item is in focus, keyboard shortcuts do not work
Created attachment 417343 [details]
Test Case with instructions
One Firebug issue that prompted this bug report is:
http://code.google.com/p/fbug/issues/detail?id=2574

Comment 3

8 years ago
Boris is this possible or is there another path?
Whiteboard: [firebug-p2]

Comment 4

8 years ago
Not sure we need yet another bug on this...
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 329509
You need to log in before you can comment on or make changes to this bug.