Closed Bug 170547 Opened 23 years ago Closed 22 years ago

Caret is in the wrong place after deleting <LI>'s

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla1.5alpha

People

(Reporter: kmcclusk, Assigned: smontagu)

References

Details

(Whiteboard: EDITORBASE+)

Attachments

(2 files, 1 obsolete file)

1. click on bold 2. enter the text "this is a test" 3. click on <LI> 4. enter item1 for the first <LI> 5. hit return 6. enter item2 for the second <LI> 7. select both item1 and item2 by dragging from item2 to item1 8. Hit backspace to delete 9. Hit another backspace. It Appears to do nothing. Caret stays at the same location. (I Would expect the caret to jump to the end of "this is a test" 10. Hit another backspace It deletes the "t" in "this is a test". (I would have expected the caret to just jump to the previous line since it was on the next line below "this is a test" This seems like a caret placement issue. Step 9 probably moved the caret but it did not visually update the caret position. So when I hit the backspace a second time it jumps one line up and deletes the "t" unexpectedly.
nominating for EDITORBASE. This is a very common editing operation.
Keywords: nsbeta1
Whiteboard: EDITORBASE
In a possibly-related problem, deleting JUST the closing tag at the end of a line in Normal view causes the caret to jump to the top of the document. Release 2002102908 in Windows ME. APPLIES TO BOTH COMPOSER AND MAIL COMPOSE Applies to </p>, </li>, </h1> thru </h6> and others when another line of the same type immediately follows. Place caret at end of line and hit DELETE. The closing tag and following open tag (</p>, newline and <p>, for example) ARE deleted as expected, but the caret jumps to the top of the document. (Could be limited to Windows because newlines are CR/LF not just LF)
editorbase+, nsbeta1+ -> Joe
Assignee: mjudge → jfrancis
Keywords: nsbeta1nsbeta1+
Whiteboard: EDITORBASE → EDITORBASE+
WFM in my current tree which has a variety of unchecked-in patches. I'll revisit once i land the other work.
Status: NEW → ASSIGNED
Target Milestone: --- → M1
nevermind, i see this problem with slightly different steps. instead of drag selecting the whole list, I get the problem if I backspace through the list a char at a time.
I filed Jim booth's bug (see comment #2) as bug 179384, becasue it is unrelated to this bug. Meanwhile, this bug is actually a layout bug. Simple testcase: 1) new editor window 2) bold 3) type "xxx" 4) hit return 5) make list 6) hit backspace once (empty list disappears as expected) 7) hit backspace again (seeminly nothing happened) If you examine the content model after step 7, you will see that the editor did indeed delete a br, leaving only the one br at the end of "xxx". This is correct. There should only be one linebox now, but the caret is drawing on a second line. Since the caret requires a frame to draw, this is evidence of a dangling frame in layout. Over to Kin for disposition.
Assignee: jfrancis → kin
Status: ASSIGNED → NEW
Another way to see that this is a layout issue is to take the resulting source from my steps, create a new edit window, go to source view, and paste it in. then go back to normal. There is no blank line to click on. So that blank line is in the testcase is an artifact from layout. Clearing milestone for Kin.
Target Milestone: M1 → ---
Giving it a milestone to get it off the bug triage radar.
Priority: -- → P1
Target Milestone: --- → mozilla1.5alpha
QA Contact: sujay → sairuh
Attached patch Patch v.0 (obsolete) — Splinter Review
kin, this looks similar to the case you fixed in bug 102615, except that here there is no next-in-flow. A final patch will have to modify the preceding comments as well, of course.
Taking
Assignee: kin → smontagu
Blocks: 200360
Attached patch patch v.1Splinter Review
I was hoping for some feedback, but I'll just request review with the comment updated.
Attachment #119238 - Attachment is obsolete: true
Attachment #121323 - Flags: superreview?(kin)
Attachment #121323 - Flags: review?(kin)
Comment on attachment 121323 [details] [diff] [review] patch v.1 sr=kin@netscape.com ==== I'd remove the reference to nextInFlow from the comment and perhaps say something like: + // If the frame we are removing is a brFrame, we need a reflow so + // the line the brFrame was on can attempt to pull up any frames + // that can fit from lines below it. I don't think we need to mention the specific caret drawing case, since it is the same "pull up" problem, but it's up to you. Note that we really don't need to reflow if the br is at the end of the block, but optimizing for that case would involve walking up the parent hierarchy looking at next-in-flows and next-siblings ... I don't think we need to do this, but I thought I'd mention it anyways.
Attachment #121323 - Flags: superreview?(kin)
Attachment #121323 - Flags: superreview+
Attachment #121323 - Flags: review?(kin)
Attachment #121323 - Flags: review+
Fix was checked in a few days ago.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
vrfy'd fixed following the tests in comment 0, comment 6 and comment 7. tested with 2003.05.13 comm builds on the 3 main platforms.
Status: RESOLVED → VERIFIED
OS: Windows XP → All
Hardware: PC → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: