Closed Bug 190447 Opened 22 years ago Closed 22 years ago

Crash attempting DOM manipulation on <tree>

Categories

(Core :: XUL, defect)

defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 184202

People

(Reporter: neil, Assigned: janv)

Details

(Keywords: crash)

Attachments

(2 files)

Moving a <tree> to a different position in the XUL DOM causes Mozilla to crash. Workaround: set the selection to null first, and recreate it afterwards. [This version for a single selection tree] var index = folderTree.currentIndex; folderTree.view.selection = null; // move the folder pane box (parent of folderTree) and splitter desiredParent.insertBefore(folderPaneBox.nextSibling, desiredParent.firstChild); desiredParent.insertBefore(folderPaneBox, desiredParent.firstChild); if (index >= 0) folderTree.view.selection.select(index);
Severity: major → critical
Keywords: crash
Attached file testcase
I can't reproduce it. Is it rdfliner specific or folder pane specific ? Could you provide a stack trace ?
ASSERTION: You can't dereference a NULL nsCOMPtr with operator->(). Called from nsTreeSelection::FireOnSelectHandler() at nsTreeSelection.cpp:715 713 nsCOMPtr<nsIBoxObject> boxObject = do_QueryInterface(mTree); 714 nsCOMPtr<nsIDOMElement> elt; 715 boxObject->GetElement(getter_AddRefs(elt)); Called from nsTreeSelection::AdjustSelection() at nsTreeSelection.cpp:687 Called from nsTreeBodyFrame::RowCountChanged() at nsTreeBodyFrame.cpp:1667 Called from nsTreeBoxObject::RowCountChanged() at nsTreeBoxObject.cpp:423 Called from nsXULTreeBuilder::Rebuild() at nsTreeBuilder.cpp:1055 Called from nsXULTreeBuilder::SetTree() at nsTreeBuilder.cpp:834 Called from nsTreeBodyFrame::SetView() at nsTreeBodyFrame.cpp:703 Called from nsTreeBodyFrame::EnsureView() at nsTreeBodyFrame.cpp:601 Called from nsTreeBodyFrame::GetPrefSize() at nsTreeBodyFrame.cpp:390 ...
Attached patch One approachSplinter Review
actually this looks very similar to bug 184202
No longer blocking 105542. I need to save and restore the selection to stop the rebuild from destroying it, so I need to manually reset the tree attribute.
No longer blocks: 105542
*** This bug has been marked as a duplicate of 184202 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Component: XP Toolkit/Widgets: Trees → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: