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

  1. Load the following HTML:
<p>
	Para 1</p>
<p contenteditable="false">
	Para 2</p>
<p>
	Para 3</p>
  1. Right-click "Para 2".
  2. Paste and allow clipboard access.

A js error is thrown.

Confirmed with IE8.

Attachments (1)

6005.patch (4.1 KB) - added by Frederico Caldeira Knabben 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by Frederico Caldeira Knabben

Status: newconfirmed

Changed 14 years ago by Frederico Caldeira Knabben

Attachment: 6005.patch added

comment:2 Changed 14 years ago by Frederico Caldeira Knabben

Owner: set to Frederico Caldeira Knabben
Status: confirmedreview

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:

<p>
	Para 1[</p>
<p contenteditable="false">
	Para 2]</p>
<p>
	Para 3</p>

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.

comment:3 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_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 in reply to:  3 Changed 14 years ago by Frederico Caldeira Knabben

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 Sa'ar Zac Elias

Filed #6033.
I can reproduce the problem with the bookmark in IE8.

comment:6 Changed 14 years ago by Frederico Caldeira Knabben

Status: review_failedreview

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:7 Changed 14 years ago by Frederico Caldeira Knabben

Also... that bookmark issue is reproducible on trunk.

comment:8 Changed 14 years ago by Sa'ar Zac Elias

Status: reviewreview_passed

comment:9 Changed 14 years ago by Frederico Caldeira Knabben

For reference, the bookmark issue will be handled at #6035.

comment:10 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: review_passedclosed

Fixed with [5748].

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