Open Bug 670829 Opened 13 years ago Updated 2 years ago

Calling click() on a checkbox menuitem doesn't flip the check mark

Categories

(Core :: XUL, defect)

defect

Tracking

()

People

(Reporter: rain1, Unassigned)

Details

Unlike actually clicking on a checkbox menuitem, merely calling click() on it doesn't flip the check mark.

As far as I can tell, it's because the Execute method [1] and nsXULMenuCommandEvent [2], which are together responsible for performing the check don't get involved at all.

[1] https://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsMenuFrame.cpp#1190
[2] https://mxr.mozilla.org/mozilla-central/source/layout/xul/base/src/nsXULPopupManager.cpp#2328
> together responsible for performing the check 

I mean "performing the flip" here, sorry.
Is there a reason to not just set the 'checked' attribute?
- Does that trigger the command?
- If you mean "first flip the checked attribute, then call click()", then for code that deals with menu items in general (e.g. see bug 670830) one would need to special-case checkbox and radio menu items. That sucks.
- It seems to me that calling click() should behave the same way as actually clicking it.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.