Opened 4 years ago

Closed 4 years ago

#8691 closed Bug (fixed)

[IE] Browser crash when pasting certain content

Reported by: damo 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 damo 4 years ago.
HTMLClipboard.xls (47.0 KB) - added by damo 4 years ago.
Helper tool to populate system clipboard
8691.patch (729 bytes) - added by fredck 4 years ago.
8691_2.patch (802 bytes) - added by garry.yao 4 years ago.

Download all attachments as: .zip

Change History (16)

Changed 4 years ago by damo

comment:1 Changed 4 years ago by satya

  • Cc satya_minnekanti@… added

comment:2 Changed 4 years ago by damo

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 4 years ago by damo

Helper tool to populate system clipboard

comment:3 Changed 4 years ago by j.swiderski

  • Keywords IE7 IE6 added
  • Status changed from new to confirmed
  • Version set to 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 4 years ago by damo

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 4 years ago by j.swiderski

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 4 years ago by damo

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 4 years ago by fredck

comment:7 Changed 4 years ago by fredck

  • Component changed from General to Core : Pasting
  • Owner set to fredck
  • Status changed from confirmed to review

comment:8 Changed 4 years ago by damo

This seems to have fixed the problem. Thanks!

comment:9 Changed 4 years ago by garry.yao

  • Status changed from review to review_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 4 years ago by garry.yao

comment:10 Changed 4 years ago by garry.yao

  • Owner changed from fredck to garry.yao
  • Status changed from review_failed to review

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

comment:11 Changed 4 years ago by fredck

  • Milestone set to CKEditor 3.6.3
  • Status changed from review to review_passed

comment:12 Changed 4 years ago by garry.yao

  • Keywords IE added; IE7 IE6 removed
  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed with [7383].

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