Opened 12 years ago
Closed 11 years ago
#10301 closed Bug (fixed)
[IE9-10] - Undo fails after 3+ consecutive paste actions with JS Error.
Reported by: | Joel | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.2.1 |
Component: | General | Version: | 4.0 |
Keywords: | IE oracle | Cc: |
Description
The undo function breaks after three or more consecutive paste actions when pasting as the last characters in a paragraph. Reproducible in [ckeditor.com/demo the demo] and in nightly.
Steps:
- Go to ckeditor.com/demo
- Click to focus to the editor
- Ctrl+A and Del to clear editor
- Copy some simple text, for example the URL of the page
- Paste the text three times in a row
- Ctrl+Z or click the undo icon --> Error
Error in Console (nightly): DOM Exception: INDEX_SIZE_ERR (1) ckeditor.js, rivi 339 merkki 374
If you type something after the pastes, undo works fine until it hits the pasted text, then the error is thrown.
BUT! If there is something after the caret when pasting it doesn't fail. For example after step 3, if you type in "foo" and move the caret to "|foo" or "fo|o" and then paste three times, undo keeps working fine and no errors.
Change History (14)
comment:1 Changed 12 years ago by
Keywords: | IE added |
---|---|
Status: | new → confirmed |
Summary: | IE9 - Undo fails after 3+ consecutive paste actions with JS Error. → [IE9-10] - Undo fails after 3+ consecutive paste actions with JS Error. |
Version: | → 4.0 |
comment:2 Changed 11 years ago by
Keywords: | oracle added |
---|
comment:4 Changed 11 years ago by
comment:5 Changed 11 years ago by
Milestone: | → CKEditor 4.2.1 |
---|
comment:7 Changed 11 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | confirmed → assigned |
comment:8 Changed 11 years ago by
Status: | assigned → review |
---|
There was a problem with normalization. Bug is fixed:
- source: t/10301
- tests: t/10301
comment:9 follow-up: 10 Changed 11 years ago by
I haven't done full review, but I have questions:
- why this fix landed in range.createBookmark2 and not in node.getIndex?
- why does it not cover endContainer?
comment:10 Changed 11 years ago by
Replying to Reinmar:
I haven't done full review, but I have questions:
- why this fix landed in range.createBookmark2 and not in node.getIndex?
Because there was a problem with normalization inside range.createBookmark2
. startContainer
should be moved to the end of last child element and it wasn't.
- why does it not cover endContainer?
Good point. I wasn't able to reproduce this bug with endContainer
, but normalization was wrong. I've added fix and test for such case.
comment:11 Changed 11 years ago by
Status: | review → review_passed |
---|
I pushed several commits to both dev and tests:
- Rebased branches.
- Added extra test.
- Updated and extended doc strings.
- Optimized the code so normalize() is defined once.
- Simplified conditions.
comment:12 follow-up: 13 Changed 11 years ago by
Owner: | changed from Piotr Jasiun to Piotrek Koszuliński |
---|---|
Status: | review_passed → review |
I'm repeating this question again:
why this fix landed in range.createBookmark2 and not in node.getIndex?
I don't understand previous answer.
comment:13 Changed 11 years ago by
Replying to Reinmar:
I'm repeating this question again:
why this fix landed in range.createBookmark2 and not in node.getIndex?
I don't understand previous answer.
This fix is about setting different container and offset of the "range". Not getting. Please refer to the code.
comment:14 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
- git:872a95d
- tests:1bc5f0d
Problem can be reproduced from CKEditor 4.0 in IE9 and IE10.
JS error that Ie reports: Message: SCRIPT5022: DOM Exception: INDEX_SIZE_ERR (1)
Line: 1577
URI: /ckeditor-git/core/selection.js
NOTE: Pasting can be done with Ctrl+v or paste button. It doesn't matter whihc you use.