Closed
Bug 84757
Opened 25 years ago
Closed 25 years ago
Cut or delete in some docs removes unselected text
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: scalkins, Assigned: kinmoz)
Details
Attachments
(4 files)
Saw this on branch build
2001-06-07-13 0.9.1
Steps to repro:
1)Open attached document in Editor
2)Click and drag to select any one line with a bug link under "Hot Bugs" section.
3)Eitehr Ctrl+X or select Edit--->Cut to remove the text with link from the Hot
Bug list
Actual results: The entire "Hot Bugs" section is now removed. Edit-->Undo does
not undo the cut..the data is basically lost if you don't have a backup. (Can
get it back if you don't save changes also).
If you paste whats in the buffer, it only pastes the selected line back, not the
whole section which is gone.
Nominating nsdogfood because I was editing my status report when this occurred.
Also nsbeta1 for data loss as an undo or paste can't bring back missing text. If
users forget to "not save", they can lose their data.
Comment 3•25 years ago
|
||
where was this file orignally created? was this a 6.x created file or a 4.x
created file?
Created in 4.7 composer . I attempted to edit it in 6.1 composer
Comment 5•25 years ago
|
||
The document does not have to be generated in 4.x to show this problem, this is
easily reproducible, if for example you set the caret within the text string
'nhgn' in the first line item under 'Hot Bugs' and triple click to select the
entire line, and then hit delete -- the entire section gets deleted. I turned
the log on and captured what it printed out on the console:
I am inside the initialize
Hey : You are in QFA Startup
(QFA)Talkback loaded Ok.
Net2Phone.js has been interpreted...
Document http://bugzilla.mozilla.org/showattachment.cgi?attach_id=37682 loaded s
uccessfully
Net2Phone.js has been interpreted...
selRanges = [ [ [[1, 2, 15, 3, 0], 0], [[1, 2, 15], 5] ] ];
EditorSetSelectionFromOffsets(selRanges);
window.editorShell.DeleteSelection(1);
// WillDo: PlaceholderTxn: Deleting
// DidDo: PlaceholderTxn: Deleting(0)
// WillDo: EditAggregateTxn:
// WillMerge: PlaceholderTxn: Deleting <-- EditAggregateTxn:
// DidMerge: PlaceholderTxn: Deleting <-- EditAggregateTxn: (TRUE, 0)
// DidDo: EditAggregateTxn: (0)
// WillDo: JoinElementTxn
// WillMerge: PlaceholderTxn: Deleting <-- JoinElementTxn
// DidMerge: PlaceholderTxn: Deleting <-- JoinElementTxn (TRUE, 0)
// DidDo: JoinElementTxn(0)
Playback ERROR: Line 0 [Exception... "Component returned failure code: 0x800040
03 (NS_ERROR_INVALID_POINTER) [nsIDOMRange.setStart]" nsresult: "0x80004003 (NS
_ERROR_INVALID_POINTER)" location: "JS frame :: chrome://editor/content/editor.
js :: EditorSetSelectionFromOffsets :: line 1921" data: no]
After poking around I think I see what is happening. The code for that area is
this:
<p><b>Hot Bugs</b>
<br><a href="http://bugscape.netscape.com/show_bug.cgi?id=3835">3825</a>-
cngf nhgn parameter
<br><a href="http://bugscape.netscape.com/show_bug.cgi?id=4776">4776</a>-
gfngnf
Notice that it is all within the paragraph starting the Hot Bugs line --- ending
the paragraph after the Hot Bugs and then retesting only deleted the two lines
with the links, however, if you set the focus into either line, they both show
that they are in a paragraph, and they are not (it should be stating bodytext)
-- I ended the paragraph on the previous line. Once I highlighted the lines with
the links, changed to bodytext and then did the delete it worked fine.
For some reason, the editor is not getting updated as to the type of parent it
should have.
kin I am giving this one to you to help debug, please reassign as appropriate
Assignee: beppe → kin
Priority: -- → P2
Target Milestone: --- → mozilla0.9.2
Comment 6•25 years ago
|
||
| Assignee | ||
Comment 10•25 years ago
|
||
I just attatched 2 files, the first one is a smaller test case that makes
debugging a little bit easier.
The 2nd file contains 2 stack traces. Stack #1 shows that we are removing the
paragraph containing the line we are deleting, because of a join operation.
Stack #2 is an assertion being thrown because mDocChangeRange still points to
the paragraph removed in Stack #1.
Joe, Stack #2 is the stack trace I was trying to describe for you yesterday that
I ran across when deleting some text in a list item.
| Assignee | ||
Comment 11•25 years ago
|
||
So it seems that one of jfrancis' checkins yesterday:
http://bonsai.mozilla.org/showcheckins.cgi?person=jfrancis%25netscape.com&treeid
=SeaMonkey&batchid=550
fixed the deletion problem in all the test cases attatched to this bug. Thanks
Joe.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 12•25 years ago
|
||
Suzanne says:
works great now.
Coolness!
I saw if fixed on Win32 2001-06-20-06Trunk build
marking verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•