Open Bug 308287 Opened 19 years ago Updated 2 years ago

listbox wants removeAllItems() method

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect

Tracking

()

People

(Reporter: surkov, Unassigned)

References

(Blocks 1 open bug)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

Element <menulist> has removeAllItems() method. I guess <listbox> should have it
too.

Reproducible: Always
<method name="removeAllItems">
<body><![CDATA[
var rowCount = this.getRowCount();
for( var i = rowCount; i > 0; i-- ) this.removeItemAt(i);
]]></body>
</method>
Although we only wrote it for menulist because it has a custom implementation.
Assignee: jag → nobody
Blocks: 531537
(In reply to comment #0, comment #1)
This sounds like a valid request for enhancement, and seems to have a proposed patch in comment #1 (which also avoids the problems of bug 531537). So I guess it should be confirmed?

(In reply to comment #2)
The current implementation of menulist's removeAllItems method has problems (bug 531537: menulist.removeAllItems destroys menulist.menupopup instead of removing all items, breaks onmenupopup handler of menulist)
As there was no reply contrary to comment 3, I assume this can be confirmed.
Alexander, could you post your patch from comment 1 as an attachment and set a review request flag?
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #4)
> As there was no reply contrary to comment 3, I assume this can be confirmed.
> Alexander, could you post your patch from comment 1 as an attachment and set a
> review request flag?

Unfortunately I'm not sure I have a time until Firefox 4 ships.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.