Closed Bug 34546 Opened 26 years ago Closed 26 years ago

XUL-specified <treeitem> cannot have <treechildren>

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: waterson, Assigned: hyatt)

References

Details

Attachments

(2 files)

I think that I opened a bug on this a long time ago, but it was either never fixed or has regressed. This XUL does not work: <tree> <treecol /> <treechildren> <treeitem id="container"> <treerow> <treecell indent="true" value="I have kids!"/> </treerow> <treechildren> <treeitem> <treerow> <treecell indent="true" value="Test #1.1" /> </treerow></treeitem> <treeitem> <treerow> <treecell indent="true" value="Test #1.2" /> </treerow></treeitem></treechildren></treeitem> <treeitem> <treerow> <treecell indent="true" value="Test #2" /> </treerow></treeitem> <treeitem> <treerow> <treecell indent="true" value="Test #3" /> </treerow></treeitem></treechildren></tree> Specifically, the "I have children!" row cannot be opened via double-click. Even more interesting, specifying "open='true'" on the <treeitem> with the id="container" causes the item to be displayed as open (the children 1.1 and 1.2 are displayed), and the container can be opened and closed with double click. This should work, right? I'm attaching a test case: the left tree has an "open='true'" attribute set on the treeitem, the right case does not. Since there is no RDF involved here, I presume there must be a bug with the tree frame construction code.
Attached file test case
I'm pretty sure that if *this* doesn't work, getting a <template> onto a <treeitem> will never work.
Blocks: 33781
Ok, so I followed the code through to nsTreeRowGroupFrame::AttributeChanged(), and it looks like the tree widget just ignores changes to the "open" attribute. This seems wrong.
Ignore previous comment. I don't know what I'm talking about. I did A-B comparison between the two trees and determined that in the "initially closed" treeitem, nsCSSFrameConstructor::ProcessRestyledFrames() isn't getting NS_STYLE_HINT_FRAMECHANGE.
...because FrameManager::ReResolveStyleContext() has no elements in the mUndisplayedMap.
FWIW, I can get this to work by returning NS_STYLE_HINT_FRAMECHANGE from nsXULElement::GetMappedAttributeImpact() for <treeitem open="...">. There don't seem to be any evil side effects from this.
Yeah, somehow the tree widget doesn't get undisplayed elements into that map. Knew about it, but don't know why or how to fix it. Only bad part about doing a framechange is that you'll rebuild the row's contents in addition to the kid's, so open/close will get slightly more expensive. Probably as good a workaround as any though.
Blocks: 34408
The fix is fine. Check it in.
actually, it's not. it causes bugs like 34408: "double newsgroup".
Great. Then I guess we'll find out why things aren't going into the undisplayed map.... accepting for M17.
Status: NEW → ASSIGNED
Target Milestone: --- → M17
if you're talking about bug 34726, that's happening anyway, on the nightly builds (i.e. without your patch)
Ok, I think I was wrong. This doesn't cause the doubling-up problems, something else does. So, hyatt: if you've got better things to do, I'll just check in the reframe for now. I'll open another bug about the map getting horked.
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: jrgmorrison → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: