Opened 10 years ago

Closed 7 years ago

#3453 closed Bug (fixed)

Content might get inserted inside <br>

Reported by: Alfonso Martínez de Lizarrondo Owned by: Garry Yao
Priority: Normal Milestone:
Component: General Version: SVN (CKEditor) - OLD
Keywords: Firefox Cc:

Description

Applies to both V2 and V3

Load sample.html?sample=enterkey
Set enterMode = br
switch to source and put for example

<h1>Test</h1>

switch to design
press enter at the end of Test, so a new line starts and the node path show that we are on body
Insert a smiley
Undo
Insert again a smiley

It doesn't appear. If you check the dom you'll see that the img is a child of BR.

Tested in Firefox.

Attachments (1)

3453.patch (1.6 KB) - added by Garry Yao 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 years ago by Artur Formella

Keywords: Confirmed added

comment:2 Changed 10 years ago by Garry Yao

Keywords: Firefox added
Owner: set to Garry Yao
Status: newassigned

Changed 10 years ago by Garry Yao

Attachment: 3453.patch added

comment:3 in reply to:  description Changed 10 years ago by Garry Yao

Keywords: Review? added

Replying to alfonsoml: Nice catch, the problem here is the undo snap: the content is actually retrieved as document snapshot, which doesn't guarantee empty text node were well preserved, so when performing undo and load the saved snapshot, the original position is not any more correct due to the vanish of these empty text node.
It's impossible for us to avoid the existing of them, so a reasonable fix would be at createBookmark2 function, forcing it to jump out of empty text nodes.

comment:4 Changed 10 years ago by Garry Yao

BTW, the empty text node mentioned above is gen by L241 of enterykey logic:

			// A text node is required by Gecko only to make the cursor blink.
			if ( CKEDITOR.env.gecko )
				doc.createText( '' ).insertAfter( startBlock );

comment:5 in reply to:  4 Changed 10 years ago by Garry Yao

Replying to garry.yao: Wondering why we're having these lines since it WFM in both FF2 and FF3 to have the cursor blink even without the two lines.

comment:6 Changed 10 years ago by Garry Yao

Milestone: CKEditor 3.x

comment:7 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:8 Changed 8 years ago by Garry Yao

Status: reviewassigned

comment:9 Changed 8 years ago by Garry Yao

Keywords: Firefox added; FirefoxConfirmed removed
Status: assignedpending

I'm unable to reproduce anymore on FF3.6.16 and FF4.

comment:10 Changed 7 years ago by Jakub Ś

Resolution: fixed
Status: pendingclosed

Me neither.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy