Opened 3 years ago

Closed 3 years ago

#11384 closed Bug (fixed)

[IE&Inline] IndexSizeError thrown when pasting into non empty selection anchored in one text node

Reported by: Reinmar Owned by: Reinmar
Priority: Normal Milestone: CKEditor 4.4.2
Component: General Version: 4.0
Keywords: IE Cc:

Description (last modified by Reinmar)

Open any inline editor. Make a selection which starts and ends in the same text node. Paste something.

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C)
Timestamp: Fri, 10 Jan 2014 01:17:53 UTC


Message: IndexSizeError
Line: 1950
Char: 8
Code: 0
URI: http://dragonus/cksource/ckeditor-dev/core/selection.js


Message: IndexSizeError
Line: 1950
Char: 8
Code: 0
URI: http://dragonus/cksource/ckeditor-dev/core/selection.js

First bad commit is git:ae72e45c, but in my opinion the bug is in bookmark creation for selection. After span is inserted range's end offset is not updated, so when text node is split by the first span, the end offset becomes incorrect.

However, the question is whether selection should be still used after bookmarks were made for it.

Anyway, the code that starts the problem is in clipboard: https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/clipboard/plugin.js#L672 and the problem is that selection which is locked when focusing pastebin still contains outdated ranges.

The selection is then unlocked here https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/clipboard/plugin.js#L795 so perhaps the easiest solution is to block selection restoring or even block selection locking even earlier.

Related tickets

  • #10787 (its test was ignored because of this bug).

Change History (15)

comment:1 Changed 3 years ago by Reinmar

  • Description modified (diff)

comment:2 Changed 3 years ago by a.nowodzinski

cc

comment:3 Changed 3 years ago by j.swiderski

  • Status changed from new to confirmed

This particular issue can be reproduced from CKEditor 4.0 in IE.

There are few IndexSizeError issues: http://dev.ckeditor.com/search?q=IndexSizeError&noquickjump=1&changeset=on&milestone=on&ticket=on&wiki=on

comment:4 Changed 3 years ago by Reinmar

Closed old DUP: #10972.

comment:5 Changed 3 years ago by a.nowodzinski

  • Owner set to a.nowodzinski
  • Status changed from confirmed to assigned

comment:6 Changed 3 years ago by Reinmar

  • Milestone changed from CKEditor 4.3.3 to CKEditor 4.3.4

comment:7 Changed 3 years ago by Reinmar

  • Milestone changed from CKEditor 4.3.4 to CKEditor 4.4.1
  • Owner a.nowodzinski deleted
  • Status changed from assigned to confirmed

Sad, but we again didn't have enough time for this, tricky one.

comment:8 Changed 3 years ago by m.lewandowski

  • Owner set to m.lewandowski
  • Status changed from confirmed to assigned

comment:9 Changed 3 years ago by m.lewandowski

I've pushed the test which autmoatically will generate the exception to t/11384 branch. I had no success with locating source of the issue though.

Test was added temporarily to tt dir. I guess we'd like to move it to clipboard plugin when the fix is done.

Last edited 3 years ago by m.lewandowski (previous) (diff)

comment:10 Changed 3 years ago by Reinmar

  • Milestone changed from CKEditor 4.4.1 to CKEditor 4.4.2
  • Owner changed from m.lewandowski to Reinmar

Heh... This ticket may become new #5217. I'll give a try in 4.4.2.

comment:11 Changed 3 years ago by Reinmar

DUP reported #11953.

comment:12 Changed 3 years ago by Reinmar

Pushed branch:t/11384 on pre review.

comment:13 Changed 3 years ago by Reinmar

  • Status changed from assigned to review

comment:14 Changed 3 years ago by m.lewandowski

  • Status changed from review to review_passed

Code's ok, I've changed docs which I feel might be easier to read/get for the very first time.

comment:15 Changed 3 years ago by Reinmar

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

Fixed on master with git:4d28beb.

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