Ticket #3309 (closed Bug: fixed)

Opened 6 years ago

Last modified 5 years ago

Styles are remove when caret placed in element boundaries

Reported by: fredck Owned by: garry.yao
Priority: High 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

3309.patch (6.3 KB) - added by garry.yao 5 years ago.
3309_2.patch (7.7 KB) - added by garry.yao 5 years ago.
3309_3.patch (9.3 KB) - added by garry.yao 5 years ago.

Change History

comment:1 Changed 6 years ago by garry.yao

  • Status changed from new to closed
  • Resolution set to duplicate

DUP of #2976.

comment:2 Changed 5 years ago by fredck

  • Status changed from closed to reopened
  • Resolution duplicate deleted

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 5 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from reopened to new

Changed 5 years ago by garry.yao

comment:4 Changed 5 years ago by garry.yao

  • Status changed from new to assigned
  • Keywords Review? added

comment:5 Changed 5 years ago by fredck

  • 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 5 years ago by garry.yao

comment:6 Changed 5 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 5 years ago by damo

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

comment:8 Changed 5 years ago by fredck

  • Priority changed from Normal to High

comment:9 Changed 5 years ago by fredck

  • 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 5 years ago by garry.yao

comment:10 Changed 5 years ago by garry.yao

  • Keywords Review? added; Review- removed

comment:11 Changed 5 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:12 Changed 5 years ago by garry.yao

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed with [3690]. Click here for more info about our SVN system.

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