Closed Bug 342347 Opened 19 years ago Closed 19 years ago

<xul:key disabled="true" command="foo"/> doesn't honor disabled attribute

Categories

(Toolkit :: UI Widgets, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: WeirdAl, Assigned: WeirdAl)

References

()

Details

(Keywords: testcase)

Attachments

(2 files)

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060621 SeaMonkey/1.5a For accessibility purposes, I envisioned dynamically disabling and enabling key sets on the fly. However, when I went to test this, I got some very startling results. <xul:key disabled="true" oncommand="alert('foo');"/> You'd never see the alert. <xul:key disabled="true" command="foo"/> <xul:command id="foo" oncommand="alert('foo');"/> You would see the alert here. Testcase coming up.
Attached file testcase
According to documentation, 3 attributes are mirrored/redirected from the command element: oncommand, label and disabled. I don't know if the target (xul:key in this case) is allowed to override the command, though I can see cases for either way.
I think it's okay for a particular key combination to be disabled while the original command is enabled. <menuitem key="keyFoo" command="cmdFoo"/>
Attached patch patch, v1Splinter Review
Assignee: nobody → ajvincent
Status: NEW → ASSIGNED
Attachment #226542 - Flags: first-review?
Attachment #226542 - Flags: first-review? → first-review?(Olli.Pettay)
cc'ing bryner - this affects code he has very recently touched.
Comment on attachment 226542 [details] [diff] [review] patch, v1 I think it is ok to not to dispatch a command event in the case, when disabled="true". in other xul elements when a click happens, command event is not dispatched if disabled="true". For example http://lxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsButtonBoxFrame.cpp#148
Attachment #226542 - Flags: first-review?(Olli.Pettay) → first-review+
Comment on attachment 226542 [details] [diff] [review] patch, v1 Seeking second review (should be super-review) from bryner.
Attachment #226542 - Flags: second-review?(bryner)
Attachment #226542 - Flags: second-review?(bryner) → second-review+
Fix checked in by smaug - thanks everyone!
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: