Open Bug 467830 Opened 17 years ago Updated 3 years ago

ListHeader click event causes blue box to appear around ListItem added to ListBox using appendChild function

Categories

(Core :: XUL, defect)

x86
Windows XP
defect

Tracking

()

People

(Reporter: morac, Unassigned)

Details

(Keywords: regression, testcase)

Attachments

(1 file)

1.94 KB, application/vnd.mozilla.xul+xml
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20081202 Shiretoko/3.1b3pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20081202 Shiretoko/3.1b3pre I have a script that sorts items in a list box and I trigger the call to do this by clicking on the list header. The script removes the entries from the list using the removeItemAt function and adds them back using the appendChild function. After the items are added back they are all surrounded by a blue dotted line box. If I create a button which calls the sorting function this does not occur. See the attached example Reproducible: Always Steps to Reproduce: 1. From an event handler attached to the listheader, append a list item to a list. In the attached example, clicking either the list header or the button will alternately add and remove the list items. If the list header is the one that triggers the add, the problem occurs. Actual Results: a Blue dotted box appears around each added list item with no apparent way to get rid of it. This is how it works in Firefox 3.0.4 and Firefox 3.1b3pre Expected Results: No blue dotted box should appear. This is how it works in Firefox 2.0.0.18
Attached file Bug 467830 example
A simple example which demonstrates the problem. Click the header or button to alternately remove/add the list items. If the header is what triggers the add, the problem will occur. If the button triggers the add, the problem does not occur.
Version: unspecified → 1.9.1 Branch
It looks like the problem occurs because all the listitems get the "current" attribute set to "true" somehow. This triggers the listbox:focus > listitem[current="true"] CSS style rule which adds the formatting. I'm not sure why they all get marked "current".
Regressed around second half Oct 2007. I'll try to find a range.
Version: 1.9.1 Branch → unspecified
The range is http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=2007-10-19+18%3A00&maxdate=2007-10-19+21%3A00 but I don't see how the about dialog could have something to do with it. So we make it a it some hours wider and after double-checking it is: http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&date=explicit&mindate=2007-10-19+14%3A00&maxdate=2007-10-20+05%3A00 Phil, Bug 399829 has nothing to do with this bug, right?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression, testcase
Nope, it would only be me if the testcase was including aboutDialog.css (well, it wouldn't anyway, but the fact that it doesn't makes it more certain). I don't actually understand bug 398135, but it exposing a bug in the listbox binding's tracking of .current at least seems vaguely plausible.
Could be. Someone who understands this binding would have to dig into it a bit...
This is because we don't have any left document notifications in xbl, so lists rely on some fairly buggy code to update the current/selected items when items are removed. It's possible that the patch in bug 331513 fixes or improves things.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: