Open Bug 338156 Opened 18 years ago Updated 2 years ago

Disabling a listbox does not disable its child listitems properly

Categories

(Core :: XUL, defect)

defect

Tracking

()

People

(Reporter: iannbugzilla, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

If you have a listbox of several child listitems and then disable the listbox, the listitems should also become disabled. This only partially happens. Test case to follow.
Attached file Testcase (deleted) —
Test case for bug
Attached patch Possible fix (deleted) — Splinter Review
This patch adds a disabled property and relevant methods to support it for both xpfe and toolkit.
Assignee: jag → iann_bugzilla
Status: NEW → ASSIGNED
Attachment #222211 - Flags: review?(neil)
Blocks: 125188
I don't understand the point of this bug; the testcase works fine for me, once I'd added in the global stylesheet. See also bug 98595.
What I see when I run this testcase in SeaMonkey 1.0.1: * Toggle listbox disabled: the listitem checkboxes appear enabled, while the listitem labels appear disabled. The listitem checkboxes are really disabled. * Toggle listitem disabled: the listitem checkboxes and labels appear and are disabled. To reproduce this visually, click on the "Toggle Item One Disabled" button, then on the "Toggle ListBox disabled" button. Then compare the rows of the textbox. The patch iterates through the children of the listbox and recursively sets their disabled state. I think this is wrong; it should be possible to set individual listitems within the listbox as disabled, and have that persist after the listbox is re-enabled. I think the correct solution is to fix the skinning of the listitem's disabled selector to include the possibility that the listbox is disabled while the listitem is not.
I tried an updated test case with the following line added: <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> This did not change the behaviour of the checkboxes in that they do not appear disabled (even if they actually are) or whichever line is selected does not appear disabled either.
Note for both windows and linux, checkboxes are not greyed out and highlighted line's text is not disabled either.
OK, so there are two issues here: 1. Labels of selected listitems should grey out when the listbox is disabled. This is easily solved with a bit of CSS. 2. Checkboxes of listitems should grey out when the listbox is disabled Unfortunately, except in the Modern theme, checkboxes are drawn by appearance code which only understands looking at the element itself. Now Ian's proposal is to make the disabled setter update all the listitems, which as Al points out loses information on which listitems where previously disabled. Additionally he has copied the radio getter, which makes the listbox unfocusable if it has no enabled items. Disabling items is only designed to stop you toggling checkboxes and does not affect selection. For this reason I think this patch is wrong.
Attachment #222211 - Flags: review?(neil)
Assignee: iann_bugzilla → jag
Status: ASSIGNED → NEW
Assignee: jag → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: