Closed
Bug 178264
Opened 22 years ago
Closed 22 years ago
nsRangeUpdater bugs and enhancements
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
M1
People
(Reporter: mozeditor, Assigned: mozeditor)
Details
(Whiteboard: fixinhand; need r=, sr=)
Attachments
(1 file, 1 obsolete file)
22.15 KB,
patch
|
Details | Diff | Splinter Review |
While working on bug 143338 I found a few bugs and limitations in nsRangeUpdater.
1) nsRangeUpdater does not protect against multiple registrations of the same
nsRangeItem, which can lead to multiple adjustment of te same range item.
2) nsRangeUpdater assumed that it had ownership of all nsRangeItems passed to
it, and that they were all on the heap (it called delete to free them). This
assumption ended up not being very convenient for the caller.
3) nsRangeUpdater notification methods were incomplete for deletion. While
DeleteText() and DeleteNode() called into nsRangeUpdater, DeleteSelection() didn't.
4) nsRangeUpdater had some dead code.
Next is a patch for all this, which also fixes some broken comments, unused
variables, etc, here and there.
Assignee | ||
Comment 1•22 years ago
|
||
The only suxy part of this patch is that I had to move the deletion notifyers
for nsRangeUpdater down into the delete transactions themselves, further
poluting their api. But since most of the txns already have a poluted api
(taking an nsIEditor as an Init param, usually) this is just more sauce for the
goose.
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Whiteboard: fixinhand; need r=, sr=
Target Milestone: --- → M1
Comment 2•22 years ago
|
||
Comment on attachment 105067 [details] [diff] [review]
patch to editor/libeditor/base
in DeleteElementTxn.cpp, around line 113, fix this typo: nlike (unlike?)
r=brade
Attachment #105067 -
Flags: review+
Comment on attachment 105067 [details] [diff] [review]
patch to editor/libeditor/base
==== Just in case ... should we be initializing mRangeUpdater in the
constructors for DeleteElementTxn and DeleteRangeTxn like we do in
DeleteTextTxn?
==== Do we have to be concerned about the fact that DeleteTextTxn will call
|mRangeUpdater->SelAdjDeleteText()| during a redo? I was just curious since the
range updater is never used during a redo of a DeleteElementTxn.
Assignee | ||
Comment 4•22 years ago
|
||
I fixed brade's typo; I corected the constructors for DeleteElementTxn and
DeleteRangeTxn (good catch); and I added range updating to
DeleteElementTxn::RedoTransaction() (another good catch).
Fix landed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•22 years ago
|
||
oops. can't check this in yet becasue it depends on patch to 143338, which is
not yet reviewed. reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 6•22 years ago
|
||
Attachment #105067 -
Attachment is obsolete: true
Assignee | ||
Comment 8•22 years ago
|
||
marking...
Status: ASSIGNED → RESOLVED
Closed: 22 years ago → 22 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•22 years ago
|
||
self verifying this (preventive maintainance only...)
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•