Closed Bug 339232 Opened 18 years ago Closed 18 years ago

ContentAppended can append multiple elements

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

From reading checkins I recently noticed that ContentAppended can append multiple elements. However nsTreeContentView only assumes one element is appended. This seems to resolve a problem that I have unfortunately since worked around in the caller so that I no longer have a convenient testcase.
Attached patch Proposed patchSplinter Review
OK, I've figured out what the testcase is, although not enough to work out how to write one that works in content. The bug only occurs if all the following conditions are true: a) your RDF is already loaded b) your tree is already visible c) you are not using flags="dont-build-content" d) you have an explicit <treechildren/> element outside the template.
Once all these conditions are met, any changes to the datasources or ref of the tree will generate a single content appended notification for multiple elements.
Assignee: Jan.Varga → neil
Status: NEW → ASSIGNED
Attachment #223321 - Flags: superreview?(bzbarsky)
Attachment #223321 - Flags: review?(enndeakin)
Attachment #223321 - Flags: approval-branch-1.8.1?(bzbarsky)
Attachment #223321 - Flags: review?(enndeakin) → review+
Comment on attachment 223321 [details] [diff] [review]
Proposed patch

Looks good, but GetChildCount() returns a PRUint32.  So please change childCount to that type, and cast in the comparison?

sr+a=bzbarsky with that.
Attachment #223321 - Flags: superreview?(bzbarsky)
Attachment #223321 - Flags: superreview+
Attachment #223321 - Flags: approval-branch-1.8.1?(bzbarsky)
Attachment #223321 - Flags: approval-branch-1.8.1+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: xptoolkit.trees → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: