Opened 14 years ago
Last modified 14 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)
Change History (5)
Changed 14 years ago by
Attachment: | 6744.patch added |
---|
comment:1 Changed 14 years ago by
Component: | General → Core : Selection |
---|---|
Keywords: | HasPatch added |
Status: | new → confirmed |
comment:2 Changed 14 years ago by
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 14 years ago by
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 14 years ago by
Version: | → 3.0 |
---|
(setting version to the lowest stable of CKEditor, not sure if issue exists since 3.0 though)
Looks important, but did you tracked this from some real world bug?