Opened 9 years ago

Last modified 8 years ago

#6744 confirmed Bug

Range: checkStartOfBlock not forgiving bogus node

Reported by: Arne Owned by:
Priority: Normal Milestone:
Component: Core : Selection Version: 3.0
Keywords: HasPatch Cc:

Description

checkStartOfBlock returns "false" for the following case:

<p><br>^</p>

From the code perspective the cursor might not be at the start of the block, but visually it is.

Pertains to non-IE browsers.

Attachments (1)

6744.patch (1000 bytes) - added by Garry Yao 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Garry Yao

Attachment: 6744.patch added

comment:1 Changed 9 years ago by Garry Yao

Component: GeneralCore : Selection
Keywords: HasPatch added
Status: newconfirmed

Looks important, but did you tracked this from some real world bug?

comment:2 Changed 9 years ago by Arne

Yes. The case I had was a table cell

<td><br></td>

with the cursor blinking in the cell. Visually the cursor is both at the start and end of the cell. checkStartOfBlock reported false when I retrieved the current Range object. I wrote test cases to verify it and found that it's the same for

<p><br></p>

I have currently made a custom patch on our system which seems to work so far. Can't predict the possible side affects of such a change. But in the evaluator function getCheckStartEndBlockEvalFunction in range.js I changed the line

if ( !isStart && !CKEDITOR.env.ie && node.getName() == 'br' && !hadBr )

to

if (!CKEDITOR.env.ie && node.is('br') && !hadBr )

comment:3 Changed 9 years ago by Arne

From the Range object's perspective the cursor is probably located after the <br> element which causes the evaluator function to return false...

comment:4 Changed 8 years ago by Wiktor Walc

Version: 3.0

(setting version to the lowest stable of CKEditor, not sure if issue exists since 3.0 though)

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