Opened 6 years ago

Closed 6 years ago

#8691 closed Bug (fixed)

[IE] Browser crash when pasting certain content

Reported by: Damian Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.6.3
Component: Core : Pasting Version: 3.1
Keywords: IBM IE Cc: satya_minnekanti@…

Description

When pasting certain HTML content from an application like IBM Sametime into CKEditor, the browser will crash. This is consistently reproducible.

This issue was originally reported against IE8 by a customer.

When testing in IE9, switch the "Document Mode" to "IE7 Standards". It does not appear to crash in other document modes.

The crash usually occurs in plugins/selection/plugin.js line 1719 on the call to ieRange.select() or an earlier line with the same call:

....
else
{
	this.setEndBefore( endNode );
	endNode.remove();
1719 -> ieRange.select();
}

this.document.fire( 'selectionchange' );
....

To reproduce:

  1. Copy a snippet of a chat log from IBM Sametime. Alternatively, the clipboard HTML data flavor has been attached to this ticket.
  2. Use CTRL+A in CKEditor, then CTRL+V to paste

Result: the browser crashes

Attachments (4)

8691 - Clipboard HTML.txt (4.4 KB) - added by Damian 6 years ago.
HTMLClipboard.xls (47.0 KB) - added by Damian 6 years ago.
Helper tool to populate system clipboard
8691.patch (729 bytes) - added by Frederico Caldeira Knabben 6 years ago.
8691_2.patch (802 bytes) - added by Garry Yao 6 years ago.

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by Damian

Attachment: 8691 - Clipboard HTML.txt added

comment:1 Changed 6 years ago by Satya Minnekanti

Cc: satya_minnekanti@… added

comment:2 Changed 6 years ago by Damian

I believe I have narrowed down the problem to the following clipboard data:

<style type='text/css'>body {overflow:hidden; } </style><b>Some Text</b>

Specifically, the overflow:hidden in the style.

To reproduce the problem, you can use the VBA form found inside the attached Excel file. It was created using the instructions from Microsoft here http://support.microsoft.com/kb/274308

Changed 6 years ago by Damian

Attachment: HTMLClipboard.xls added

Helper tool to populate system clipboard

comment:3 Changed 6 years ago by Jakub Ś

Keywords: IE7 IE6 added
Status: newconfirmed
Version: 3.1

This is the reduced code for 8961- Clipboard HTML.txt file. (Please see testfile.html)

<html>
<body>
	<style type='text/css'>
		body { overflow:hidden; }
	</style>
	<html>
		<head>
			<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
		</head>
		<body>
			<table>
				<td nowrap width="120px" style="width:120px; white-space:nowrap" class="other">..</td><td width="330px" style="width:330px"><span class="left" style="font-size: 8pt; font-family: Tahoma; color: rgb(0, 0, 0);">thx</span></td><td>&nbsp;</td>
			</table>
		</body>
	</html>
</body>
</html>

To reproduce the ticket:

  1. Open this file in IE7 or IE6, press CRTL+A, CRTL+C
  2. Use CTRL+A in CKEditor (on its contents), then CTRL+V to paste

Result:
Browser will crash.
This issue has only been reproducible in IE7 and IE6 from CKEditor 3.1


Why this ticket is not valid for IE9 and IE8
As you can see above this is quite not up to standards HTML. All in all it should not break the browser. Well and it doesn't - If you set IE9 to IE7 document mode manually then you will break the browser but if you do it the proper way, that is set <meta http-equiv="X-UA-Compatible" content="IE=7" /> in E.g. fullpage.html sample, open this page in IE9/IE8 and then paste invalid HTML the browser will not break.

comment:4 Changed 6 years ago by Damian

If IE8 or IE9 is set to load pages in Compatibility View, this issue will be reproducible, even with the meta tag set. To reproduce this, in IE9 or IE8 go to menu Tools->Compatibility Views settings and ensure the compatibility view setting will be set for the given page.

comment:5 Changed 6 years ago by Jakub Ś

If IE8 or IE9 is set to load pages in Compatibility View

@damo this is still using developer tools.

Anything related to the IE Developer Tools is to be ignored as we don't support it. Only "real pages" can be used for testing and to the confirm issues - X-UA-Compatible is the only acceptable way for it.

To summarize - This ticket is valid for IE7 and IE6 but not for IE8 and Ie9.

comment:6 Changed 6 years ago by Damian

As long as this is fixed to work properly in native IE7, I would then expect it to work in IE8+ as well, with Compatibility View turned on. The X-UA-Compatible header does not affect this setting in the IE8+ browsers.

Changed 6 years ago by Frederico Caldeira Knabben

Attachment: 8691.patch added

comment:7 Changed 6 years ago by Frederico Caldeira Knabben

Component: GeneralCore : Pasting
Owner: set to Frederico Caldeira Knabben
Status: confirmedreview

comment:8 Changed 6 years ago by Damian

This seems to have fixed the problem. Thanks!

comment:9 Changed 6 years ago by Garry Yao

Status: reviewreview_failed

Let's try to figure out a patch without using timeout since that would defer the real insertion happens even further which may break other things.

http://ckeditor.t/tt/8691/1.html

Changed 6 years ago by Garry Yao

Attachment: 8691_2.patch added

comment:10 Changed 6 years ago by Garry Yao

Owner: changed from Frederico Caldeira Knabben to Garry Yao
Status: review_failedreview

New patch reorder a bit the bookmark selection which should be enough to eliminate the browser crash.

comment:11 Changed 6 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.6.3
Status: reviewreview_passed

comment:12 Changed 6 years ago by Garry Yao

Keywords: IE added; IE7 IE6 removed
Resolution: fixed
Status: review_passedclosed

Fixed with [7383].

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