Opened 11 years ago

Closed 11 years ago

#11384 closed Bug (fixed)

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

Reported by: Piotrek Koszuliński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.4.2
Component: General Version: 4.0
Keywords: IE Cc:

Description (last modified by Piotrek Koszuliński)

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 11 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:2 Changed 11 years ago by Olek Nowodziński

cc

comment:3 Changed 11 years ago by Jakub Ś

Status: newconfirmed

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 11 years ago by Piotrek Koszuliński

Closed old DUP: #10972.

comment:5 Changed 11 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: confirmedassigned

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

Milestone: CKEditor 4.3.3CKEditor 4.3.4

comment:7 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.3.4CKEditor 4.4.1
Owner: Olek Nowodziński deleted
Status: assignedconfirmed

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

comment:8 Changed 11 years ago by Marek Lewandowski

Owner: set to Marek Lewandowski
Status: confirmedassigned

comment:9 Changed 11 years ago by Marek 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 11 years ago by Marek Lewandowski (previous) (diff)

comment:10 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.1CKEditor 4.4.2
Owner: changed from Marek Lewandowski to Piotrek Koszuliński

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

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

DUP reported #11953.

comment:12 Changed 11 years ago by Piotrek Koszuliński

Pushed branch:t/11384 on pre review.

comment:13 Changed 11 years ago by Piotrek Koszuliński

Status: assignedreview

comment:14 Changed 11 years ago by Marek Lewandowski

Status: reviewreview_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 11 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:4d28beb.

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