Closed Bug 41862 Opened 24 years ago Closed 24 years ago

nsEditor::CloneAttributes should not use undoable transactions if target element isn't in document

Categories

(Core :: DOM: Editor, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: cmanske, Assigned: cmanske)

Details

(Whiteboard: nsbeta2)

Attachments

(1 file)

Change nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode) to test if aDestNode is in the current document. If it isn't, we should go through the transaction system.
Status: NEW → ASSIGNED
Target Milestone: --- → M18
assigning this one to Simon
Assignee: beppe → sfraser
Status: ASSIGNED → NEW
Over to charley
Assignee: sfraser → cmanske
Sorry, forgot to assign it to me when created.
Status: NEW → ASSIGNED
Attached patch Fix for the bugSplinter Review
After thinking about this bug, it is an important architecture issue. If we don't fix this, the setting attributes on an element before it is inserted in the page will still use the transaction system, which is shouldn't. This will through off the undo stack so undo won't undo the last real action and the user will be confused. There is also the risk of crashing since the saved undo information won't point to elements in the page and undo/redo may try to access released elements. The fix is very straightforward -- it is attached. Nominating for beta2 -- I've already discussed the issues with beppe and she agrees it should be considered.
Whiteboard: nsbeta2
Target Milestone: M18 → M16
Approved to checkin by beppe.
Checked in last week.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Charley, can you please verify this one? thanks...
Traced through along the 2 possible code paths and it looks good.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: