Opened 3 years ago

Closed 3 years ago

#12491 closed Bug (fixed)

[Webkit/Blink] Error or incorrect selection restored on removeFillingChar

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.4.6
Component: General Version:
Keywords: Webkit Blink Cc:

Description

  1. Clear contents.
  2. Type "xx".
  3. Press left arrow once.
  4. CTRL+B.
  5. Type "yy".
  6. Press CTRL+A.

Selection first covers all text, then it's immediately moved to "x".

Depending on number of letters this may also cause error caused by wrong offsets in removeFillingChar.

Change History (6)

comment:1 Changed 3 years ago by Piotrek Koszuliński

Related ticket: #8617.

comment:2 Changed 3 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:3 Changed 3 years ago by Piotrek Koszuliński

Next case:

  1. Clear contents.
  2. Type "xx".
  3. Press left arrow once.
  4. CTRL+B.
  5. Type "yzzzzy".
  6. Select, using mouse, part "zzzz" from right to left.
  7. Selection is lost.

This TC is caused by the part of code touched in #12489 which does not handle selection direction. Code in the removeFillingChar function also does not care about selection direction and should be fixed too, because after user makes selection using mouse that code will be triggered when (s)he tries to expand selection using arrow keys.

comment:4 Changed 3 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedreview

#12491 and #12489 became too related to each other, so let's conclude both here.

Fixed TCs:

TC1:

  • Clear contents.
  • Type few letters.
  • Press SHIFT+ENTER.
  • Type few letters.
  • Click the text in the second line.
  • Selection is moved back to the end of the second line.

TC2:

  • Clear contents.
  • Press CTRL+B.
  • Type few letters.
  • Click in the middle of the line.
  • Selection is moved back to the end of the line.

TC3:

  • Clear contents.
  • Press CTRL+B.
  • Type 4 characters.
  • Select 2 and 3 character by mouse.
  • Selection is moved to the beginning of the line.

TC4:

  • The same as TC3, but make sure to select text from right to left.
  • If TC3 worked correctly, check if you can expand the selection using SHIFT+LEFT. If selection's direction was not preserved the selection will shrink instead of expanding.

TC5:

  • Clear contents.
  • Type "xx".
  • Press left arrow once.
  • CTRL+B.
  • Type "yy".
  • Press CTRL+A.
  • Selection first covers all text, then it's immediately moved to "x".
  • Depending on number of letters this may also cause error caused by wrong offsets in removeFillingChar.

Other cases worth checking

TC6 (#8617):

  • Clear contents.
  • Type few letters.
  • CTRL+B, type few letters.
  • CTRL+I, type few letters.
  • Press left arrow.

Problem (selection moved incorrectly) can be reproduced before #8617: http://rev.ckeditor.com/ckeditor/trunk/7392/_samples/replacebycode.html

Code

Pushed branch:t/12491 which is based on branch:t/12489.

comment:5 Changed 3 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.4.6
Status: reviewreview_passed

comment:6 Changed 3 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:958d7c9.

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