Opened 14 years ago
Closed 14 years ago
#6005 closed Bug (fixed)
[3.4.x] Error when pasting over read-only blocks
Reported by: | Frederico Caldeira Knabben | Owned by: | Frederico Caldeira Knabben |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.4 |
Component: | Core : Pasting | Version: | |
Keywords: | IE | Cc: |
Description
- Load the following HTML:
<p> Para 1</p> <p contenteditable="false"> Para 2</p> <p> Para 3</p>
- Right-click "Para 2".
- Paste and allow clipboard access.
A js error is thrown.
Confirmed with IE8.
Attachments (1)
Change History (11)
comment:1 Changed 14 years ago by
Status: | new → confirmed |
---|
Changed 14 years ago by
Attachment: | 6005.patch added |
---|
comment:2 Changed 14 years ago by
Owner: | set to Frederico Caldeira Knabben |
---|---|
Status: | confirmed → review |
comment:3 follow-up: 4 Changed 14 years ago by
Status: | review → review_failed |
---|
- The first and last paragrpahs are merged with the pasted content between them, I believe the expected is that the pasted content would be between them.
- There is a bookmark left in the content.
comment:4 Changed 14 years ago by
Replying to Saare:
- The first and last paragrpahs are merged with the pasted content between them, I believe the expected is that the pasted content would be between them.
This is out of the scope of this ticket. Please open a dedicated ticket for it.
- There is a bookmark left in the content.
I'm not able to reproduce it. Can you give us more information on how to see the issue?
comment:5 Changed 14 years ago by
Filed #6033.
I can reproduce the problem with the bookmark in IE8.
comment:6 Changed 14 years ago by
Status: | review_failed → review |
---|
Ok, I'm able to reproduce it also, in IE8+Standards mode. But it has nothing to do with this ticket. It happens before patch also.
Please open a dedicated ticket for it. I'll investigate it meanwhile.
comment:8 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:10 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [5748].
The root of the problem is an IE bug with contenteditable=false stuff.
To illustrate, on the tc, when right-clicking, we have the following selection:
So, the selection is inside the read-only element, instead of containing it entirely. This fact makes IE break when calling pasteHTML (unspecified error!).
To workaround it, we need to make the checks proposed in the patch, eventually fixing the selection.
To properly achieve it, I had to change range.checkBoundaryOfElement a bit, so I had also to fix its usage in the styles plugin.