Closed
Bug 12675
Opened 25 years ago
Closed 25 years ago
[DOGFOOD] undoing typing is broken
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
M11
People
(Reporter: akkzilla, Assigned: mozeditor)
References
Details
(Whiteboard: [PDT]+)
Joe writes:
undoing typing is broken, in that typed characters are not properly merging into
one undo. This was true both before and after the insert text refactoring. I
may want some advice from Steve or Kin on this - as there is code there to do
this that I have somehow broken, long ago. Needed for dogfood.
Reporter | ||
Updated•25 years ago
|
Reporter | ||
Comment 1•25 years ago
|
||
Adding dependencies: it's a dogfood bug, and undo of insert html can't be
written until inserting of nodes and text are fixed.
The problem here is that WillInsertText() is opening a transaction batch
every time, even when it is executing a single transactions. The transaction
manager does not support batch merging, only transaction merging.
I suggest modifying WillInsertText() to only open a batch when it is going to
execute more than one transaction.
Here's a log file that illustrates what happens when I type 'abc' in a blank
document and then undo it 3 times. As stated above, if we removed the begin/end
batches around the transactions that inserted 'b' and 'c', those 2 transactions
would be merged into one.
selRanges = [ [ [[0, 1, 0, 0], 0], [[0, 1, 0, 0], 0] ] ];
EditorSetSelectionFromOffsets(selRanges);
window.editorShell.InsertText("a");
// WillBeginBatch: 0
// DidBeginBatch: 0 (0)
// WillDo: <NULL>
// DidDo: <NULL>(0)
// WillDo: Remove Element:
// DidDo: Remove Element: (0)
// WillDo: Create Element: special text node tag
// DidDo: Create Element: special text node tag(0)
// WillDo: Insert Text: a
// DidDo: Insert Text: a(0)
// WillEndBatch: 0
// DidEndBatch: 0 (0)
selRanges = [ [ [[0, 1, 0], 1], [[0, 1, 0], 1] ] ];
EditorSetSelectionFromOffsets(selRanges);
window.editorShell.InsertText("b");
// WillBeginBatch: 0
// DidBeginBatch: 0 (0)
// WillDo: <NULL>
// DidDo: <NULL>(0)
// WillEndBatch: 0
// DidEndBatch: 0 (0)
selRanges = [ [ [[0, 1, 0], 2], [[0, 1, 0], 2] ] ];
EditorSetSelectionFromOffsets(selRanges);
window.editorShell.InsertText("c");
// WillBeginBatch: 0
// DidBeginBatch: 0 (0)
// WillDo: <NULL>
// DidDo: <NULL>(0)
// WillEndBatch: 0
// DidEndBatch: 0 (0)
window.editorShell.Undo();
// WillUndoBatch
// WillUndo: <NULL>
// DidUndo: <NULL>(0)
// EndUndoBatch (0)
window.editorShell.Undo();
// WillUndoBatch
// WillUndo: <NULL>
// DidUndo: <NULL>(0)
// EndUndoBatch (0)
window.editorShell.Undo();
// WillUndoBatch
// WillUndo: Insert Text: a
// DidUndo: Insert Text: a(0)
// WillUndo: Create Element: special text node tag
// DidUndo: Create Element: special text node tag(0)
// WillUndo: Remove Element:
// DidUndo: Remove Element: (0)
// WillUndo: <NULL>
// DidUndo: <NULL>(0)
// EndUndoBatch (0)
Assignee | ||
Comment 4•25 years ago
|
||
accepting bugs; setting to m11
Assignee | ||
Comment 5•25 years ago
|
||
i'll probably check what Kin suggests, this weekend - but i suspect that paste is
not going to have the expected undo behavior without some more serious
alterations.
Reporter | ||
Comment 6•25 years ago
|
||
I was under the impression that undoing of paste has been working fine
(plaintext paste, anyway; there was a bug with undoing html insertions, which is
fixed now).
What unexpected behavior do you think paste will have, and did it have that
unexpected behavior before?
Joe, if are worried about the InsertText transactions, created by the paste,
absorbing other InsertText transactions generated by the user typing or another
paste, that can be solved by adding begin/end batch calls to the paste code to
prevent merging.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•25 years ago
|
||
fixed
still a problem I believe...
I typed: "Undo" in the first line. Then I pulled down Edit | Undo.
The result was: "U". SHouldn't it all be merged into one undo?
Comment 10•25 years ago
|
||
Clearing FIXED resolution due to reopen of this bug.
Updated•25 years ago
|
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Comment 11•25 years ago
|
||
this works for me and sfraser@netscape.com.
Resolve as fixed. Sujay: can you please retest and let us know which platforms
have this problem or if there are any extra steps or ??? thanks!!!
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → REOPENED
Reporter | ||
Comment 12•25 years ago
|
||
I just tried it on Linux; if I typed undo in the middle of an existing text
node, Undo undid the whole world, but if I preceded it with a
select-all/click/backspace and typed undo in a new document, it removed the ndo
but left the U.
Comment 13•25 years ago
|
||
yes I'm seeing the same thing what Akkana is seeing on Windows also...
Updated•25 years ago
|
Resolution: FIXED → ---
Comment 14•25 years ago
|
||
I only see this problem if I select all and then press delete and then type or if
I get a blank page (from the browser) and begin typing.
Assignee | ||
Updated•25 years ago
|
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•25 years ago
|
||
fixed
Comment 16•25 years ago
|
||
verified in 9/21 build.
Comment 17•25 years ago
|
||
Putting on [PDT]+ radar.
You need to log in
before you can comment on or make changes to this bug.
Description
•