Opened 15 years ago

Closed 15 years ago

#2757 closed Bug (fixed)

Selection is not restored properly from bookmark2 in this case.

Reported by: jorenm@… Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.4
Component: General Version: FCKeditor 2.6.3 Beta
Keywords: Confirmed Review+ Cc:

Description

If you have a non-intrusive bookmark of a text selection that has a previous sibling that is not a text node FCK will not re-select it properly. The problem is that the bookmark creation code assumes the previous sibling will be a text node and it will break the bookmark if it is not.

These changes to the while loops fix it (fckdomrange.js line 477):

Old:

while ( curStart && addrStart.nodeType == 3 )
while ( curEnd && addrEnd.nodeType == 3 )

New:

while ( curStart && curStart.nodeType == 3 && addrStart.nodeType == 3 )
while ( curEnd && curEnd.nodeType == 3 && addrEnd.nodeType == 3 )

Attachments (1)

2757.patch (884 bytes) - added by Artur Formella 15 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 15 years ago by Artur Formella

Keywords: Pending added

Could you provide a sample bookmark to reproduce this bug? Could you also check your editor version?

comment:2 Changed 15 years ago by jorenm@…

1) Go to http://www.fckeditor.net/demo

2) Select "are" after the bolded "sample text"

3) Hit bold

4) Hit undo

Changed 15 years ago by Artur Formella

Attachment: 2757.patch added

comment:3 Changed 15 years ago by Artur Formella

Keywords: Confirmed Review? added; Pending removed
Version: FCKeditor 2.6.3 Beta

comment:4 Changed 15 years ago by Martin Kou

Milestone: FCKeditor 2.6.4
Owner: set to Martin Kou
Status: newassigned

comment:5 Changed 15 years ago by Martin Kou

Keywords: Review+ added; Review? removed
Resolution: fixed
Status: assignedclosed

Fixed with [3026].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy