Last Comment Bug 534510 - All events are blocked on disabled form elements but some shouldn't be
: All events are blocked on disabled form elements but some shouldn't be
Status: RESOLVED DUPLICATE of bug 329509
[firebug-p2]
:
Product: Core
Classification: Components
Component: DOM: Events (show other bugs)
: unspecified
: x86 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-13 06:42 PST by Michael Ratcliffe [:miker] [:mratcliffe]
Modified: 2009-12-15 13:02 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Test Case with instructions (2.85 KB, text/html)
2009-12-13 06:44 PST, Michael Ratcliffe [:miker] [:mratcliffe]
no flags Details

Description Michael Ratcliffe [:miker] [:mratcliffe] 2009-12-13 06:42:40 PST
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
Comment 1 Michael Ratcliffe [:miker] [:mratcliffe] 2009-12-13 06:44:05 PST
Created attachment 417343 [details]
Test Case with instructions
Comment 2 Michael Ratcliffe [:miker] [:mratcliffe] 2009-12-13 06:55:20 PST
One Firebug issue that prompted this bug report is:
http://code.google.com/p/fbug/issues/detail?id=2574
Comment 3 John J. Barton 2009-12-15 12:38:15 PST
Boris is this possible or is there another path?
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2009-12-15 13:02:20 PST
Not sure we need yet another bug on this...

*** This bug has been marked as a duplicate of bug 329509 ***

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