Opened 14 years ago

Closed 14 years ago

#3880 closed Bug (fixed)

Typo in fckdomrange_ie.js

Reported by: Martin Kou Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.5
Component: General Version:
Keywords: Review+ Cc:


Line 114 of fckdomrange_ie.js says

        bIsStartMakerAlone = ( forceExpand || !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;

Take note of the last property name, "nextSibing" - it's a very subtle error but this property does not exist. It is actually causing the statement after the "&&" sign to be redundant because it always returns true.

This is actually the reason why we have this comment in CKEditor 3's selection plugin:

// The isStartMarkerAlone logic comes from V2. It guarantees that the lines
// will expand and that the cursor will be blinking on the right place.
// Actually, we are using this flag just to avoid using this hack in all
// situations, but just on those needed.
// But, in V3, somehow it is not interested on working whe hitting SHIFT+ENTER
// inside text. So, let's jsut leave the hack happen always.

// I'm still leaving the code here just in case. We may find some other IE
// weirdness and uncommenting this stuff may be useful.

The isStartMarkerAlone flag doesn't work in v3 because the ported logic doesn't have that typo.

The solution to this is to fix remove the wrong "nextSibing" condition from the line and also fix the "bIsStartMakerAlone" name typo - this one doesn't have any effect on logical correctness but is still spelled wrong.

Attachments (1)

3880.patch (1.6 KB) - added by Martin Kou 14 years ago.

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by Martin Kou

Attachment: 3880.patch added

comment:1 Changed 14 years ago by Martin Kou

Keywords: Review? added
Status: newassigned

comment:2 Changed 14 years ago by Garry Yao

Keywords: Review+ added; Review? removed

comment:3 Changed 14 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [3811].

Click here for more info about our SVN system.

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