Closed Bug 121282 Opened 23 years ago Closed 23 years ago

Pressing enter causes caret to jump from end of <p> to the<h1>

Categories

(Core :: DOM: Editor, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: TucsonTester1, Assigned: mozeditor)

Details

(Whiteboard: EDITORBASE+; fixinhand; reviewed)

Attachments

(1 file)

build: 2002011703
platform: Windows XP
ability to reproduce: always

Steps to reproduce:

1. open a blank composer document
2. choose "paragraph" from the format drop-down list and type in some text
("paragraph").
3. hit enter
4. choose "heading 1" from the format drop-down list and type in some text
("heading 1").
5. move cursor back to the end of the "paragraph" text.
6. hit enter once.

results: cursor moves to the beginning of the "heading 1" line
expected results: it would put a blank line in between the "paragraph" and the
"heading 1"

more results:

1. after noticing that cursor moves to "heading 1" line, then move cursor back
to the end of the "paragraph" line.
2. press enter several times repeatedly.

Notice how the composer finally inserts a line, but then deletes it and the
process goes back and forth as you press the enter key repeatedly.  It's very
bizarre.
Confirming on 2002011503 Win2k.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Could you please clarify step 5: is this done by clicking at the end of the line
or by pressing an arrow key or ?

Sounds like a Core bug...
nominate for EDITORBASE consideration
Assignee: syd → jfrancis
Component: Editor: Composer → Editor: Core
Summary: Pressing enter causes cursor to jump from the end of the paragraph format to the heading 1 format → Pressing enter causes caret to jump from end of <p> to the<h1>
Whiteboard: EDITORBASE
The way I did it originally (step 5) was by clicking at the end of "paragraph"
with the mouse pointer.  I did try it the other way by using the "up" arrow key
to move it back to the previous line and I still got the same results.
Marking EDITORBASE+.
Whiteboard: EDITORBASE → EDITORBASE+
Status: NEW → ASSIGNED
Whiteboard: EDITORBASE+ → EDITORBASE+; fixinhand; need r=,sr=
I have a ton of patches to this file.  I hand editted the diff here to be just
the relavant ones for this bug, but the line numbers may not match up.	

However the diff is simple: I'm just changing some IsBreak() calls to
IsVisBreak() instead.  This bug is caused by non-visible breaks fooling the
editor code into splitting the <p> when instead it should insert a <br>.
099
Target Milestone: --- → mozilla0.9.9
Keywords: nsbeta1+
Comment on attachment 67683 [details] [diff] [review]
Diffs of nsHTMLEditRules.cpp

r=glazman
Attachment #67683 - Flags: review+
Comment on attachment 67683 [details] [diff] [review]
Diffs of nsHTMLEditRules.cpp

sr=kin@netscape.com
Attachment #67683 - Flags: superreview+
Whiteboard: EDITORBASE+; fixinhand; need r=,sr= → EDITORBASE+; fixinhand; reviewed
fix landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Looks good on build 2002021108.

Marking Verified.
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: