Closed Bug 330167 Opened 19 years ago Closed 19 years ago

ChatZilla userlist is blank when swapped to the right-hand side (trunk only)

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: rdmsoft, Unassigned)

References

()

Details

(Keywords: regression)

Attachments

(3 files)

When the userlist is moved to the right (/pref userlistLeft false) it becomes empty. To get it back you need to put it back to the left and restart ChatZilla.

This doesn't happen in the 20060308 Windows Firefox nightly, but is broken in 20060309.
<http://bonsai.mozilla.org/cvsquery.cgi?date=explicit&mindate=2006-03-08+07%3A00%3A00&maxdate=2006-03-09+08%3A00%3A00>

Bug 329335 touched XUL templates in that time, but I don't know enough about the code in question and can't access the bug. Filing this in OtherApps/ChatZilla until we know any more.
CC-ing bz and Neil.

[disclaimer: I don't know the code at all. I'm making assumptions here, which is bad. Please correct me ASAP :-)]

As far as I can see, that patch basically makes the template builder go 'okay, my root node is gone, so I can forget about this'. It seems to remove some kind of observer, and generally tell the template builder "don't care about this anymore".

Again, I'm not sure if I'm being correct here, but if I am, and this (nsXULTemplateBuilder) is used for XUL trees, then this is probably why we break, since we re-root (as in, remove the root and then add it again) the tree every time:
* the user joins a channel
* the user parts from a channel
* the user changes tabs (because there's a different channel, so a different set of data that should be represented).

We also resort the tree whenever someone else joins, parts or changes their nickname. I'm not sure if that sneakily re-roots the tree too. It sure does kill the selection, so I'm tempted to guess it does.

Why this only breaks if we're on the right side... no idea. And that's a pretty big hole in my logic, actually. Anyhow, commenting all this rambling anyway, maybe it can give People Who Know a better clue as to why we break.

On that matter - we switch the userlist to the right side by doing the following (http://chatzilla.rdmsoft.com/trunk/xul/content/static.js#l2580):
* add the splitter to the left of the user list (this removes it from its previous position).
* add the content deck's container to the left of the user list (this removes it from its previous position).
* setting the collapse property on the userlist to 'after'.
What happens when a user joins/leaves/etc. is not related. That just, if anything, resets the root RDF node used by the tree, and doesn't touch the actual XUL itself.

The problem would look to be that of the addition of the ContentRemoved handler, which looks like it will nuke the template engine whenever any content element within the templated element is removed. I believe this notification will get triggered when removing the userlist from the document.
The template should be reapplied when a node is inserted into the document. A minimal testcase would be nice.

Also, it seems in this case that you are just reversing the list position, which can more easily be done just by setting the dir attribue on the container to reverse.
FWIW, Robert Marshall has confirmed that it is the ContentRemoved code that is causing the problem. Clearly the template is not being reinstated on insertion.
Try <http://bugs.rdmsoft.com/xult/flip.xul>. Clicking the button once makes one listbox break, clicking it again breaks the other one.
Blocks: 329335
If the testcase could get attached to the bug (I guess attach the RDF, then point the XUL to it, then attach the XUL?) that would be great.

Enn, can you look into this?
Assignee: rginda → nobody
Component: ChatZilla → XP Toolkit/Widgets: XUL
Flags: blocking1.9a1+
Product: Other Applications → Core
QA Contact: samuel → xptoolkit.xul
Attached file rdf/xml for testcase
Attached file testcase
Fingers crossed...
Attachment #214924 - Flags: superreview?(bzbarsky)
Attachment #214924 - Flags: superreview+
Attachment #214924 - Flags: review?(bzbarsky)
Attachment #214924 - Flags: review+
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
This doesn't appear to be resolved. See bug 367782.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: