Opened 15 years ago

Closed 15 years ago

#3309 closed Bug (fixed)

Styles are remove when caret placed in element boundaries

Reported by: Frederico Caldeira Knabben Owned by: Garry Yao
Priority: Must have (possibly next milestone) Milestone: CKEditor 3.0
Component: Core : Styles Version:
Keywords: IBM Confirmed Review+ Cc: damian.chojna@…

Description

  1. Having the following selection:
Some <strong>sample^</strong> text.
OR
Some <strong>^sample</strong> text.
  1. Press CTRL+B.

The entire work gets un-bolded, instead of simply disabling it (moving the selection to outside the touching boundary).

This issue is more often faced when typing, using CTRL+B to type a word, and then CTRL+B again to continue writing.

Attachments (3)

3309.patch (6.3 KB) - added by Garry Yao 15 years ago.
3309_2.patch (7.7 KB) - added by Garry Yao 15 years ago.
3309_3.patch (9.3 KB) - added by Garry Yao 15 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 15 years ago by Garry Yao

Resolution: duplicate
Status: newclosed

DUP of #2976.

comment:2 Changed 15 years ago by Frederico Caldeira Knabben

Resolution: duplicate
Status: closedreopened

This issue is "similar" but not really the same as the one described into #2976. We should be able to have a simple fix for it from V2.

comment:3 Changed 15 years ago by Garry Yao

Owner: set to Garry Yao
Status: reopenednew

Changed 15 years ago by Garry Yao

Attachment: 3309.patch added

comment:4 Changed 15 years ago by Garry Yao

Keywords: Review? added
Status: newassigned

comment:5 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The following case has strange effects for me:

  1. With the following code and selection:
<p><em>Some <b>^Text</b></em></p>
  1. Hitting CTRL+I for the italics.

Current results:

<p>Some <em>Some <b>Text^</b></em></p>

Changed 15 years ago by Garry Yao

Attachment: 3309_2.patch added

comment:6 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

The culprit here is range::checkBoundaryOfElement should be element sensitive when determinating if it's on element boundaries, which means it should take the target element as an another param.

range.checkBoundaryOfElement( element, CKEDITOR.START_OF_ELEMENT ); 

With this logic errors hunted down, now the following codes:

range.checkBoundaryOfElement( doc.getById('target'), CKEDITOR.START_OF_ELEMENT ); 

It should also return true with the following TCs:

<b id="target">^Element</b> 
<em id="target"><b>^Element</b></em>
<em id="target"><b>^Element</b></em> 
<em id="target">^<b>Element</b></em>
<em id="target"><b><span _fck_bookmark="1"> </span>^Element</b></em>

comment:7 Changed 15 years ago by Damian

Cc: damian.chojna@… added
Keywords: IBM added

comment:8 Changed 15 years ago by Frederico Caldeira Knabben

Priority: NormalHigh

comment:9 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

I've discussed some changes with Garry on this fix to make it a bit simpler. A new patch should be coming soon.

Changed 15 years ago by Garry Yao

Attachment: 3309_3.patch added

comment:10 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

comment:11 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:12 Changed 15 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Fixed with [3690]. 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