Opened 13 years ago

Closed 12 years ago

#9034 closed Bug (fixed)

IE: Unspecified Error when making a selection in the editor

Reported by: Teresa Monahan Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.6.4
Component: Core : Selection Version: 3.6.3
Keywords: IE7 Cc: Damian, Satya Minnekanti

Description

An 'Unspecified Error' is sometimes thrown when selecting text in the editor. We cannot reproduce this in a standalone testcase, however it happens very often in our application. It happens in IE8 and IE9 when run in IE7 document mode.

The issue happens when you select text by starting the selection at the end of the editor. We believe this is related to the following code in the selection plugin which handles the case where the user clicks below the body.

function onHover( evt )
{
	evt = evt.data.$;
	if ( textRng )
	{
		// Read the current cursor.
		var rngEnd = body.$.createTextRange();
		rngEnd.moveToPoint( evt.x, evt.y );

		// Handle drag directions.
		textRng.setEndPoint(
			textRng.compareEndPoints( 'StartToStart', rngEnd ) < 0 ?
			'EndToEnd' :
			'StartToStart',
			rngEnd );

		// Update selection with new range.
		textRng.select();
	}
}

Adding a try/catch around this code as in the attached patch seems to fix this issue. Can you see any undesired consequences of this patch?

Attachments (5)

9034.patch (1.2 KB) - added by Teresa Monahan 13 years ago.
Proposed fix
IE unspecified error.html (938 bytes) - added by Teresa Monahan 13 years ago.
ierr.html (904 bytes) - added by Jakub Ś 13 years ago.
2012-06-25_1217.swf (409.9 KB) - added by Jakub Ś 13 years ago.
9034_2.patch (818 bytes) - added by Garry Yao 13 years ago.

Download all attachments as: .zip

Change History (14)

Changed 13 years ago by Teresa Monahan

Attachment: 9034.patch added

Proposed fix

comment:1 Changed 13 years ago by Frederico Caldeira Knabben

Status: newpending

There should not be issues on holding that code inside try/catch.

In any case, to have us understanding the issue in fully, we definitely need to be able to reproduce it locally. Please let us know if you find any way to do so consistently.

Changed 13 years ago by Teresa Monahan

Attachment: IE unspecified error.html added

comment:2 Changed 13 years ago by Teresa Monahan

I attached 'IE unspecified error.html​' which provides a reproducible test case. The problem occurs when <META content="IE=7.0000" http-equiv="X-UA-Compatible"> is included in the HTML for the page.

Also note that when you click into the editor body, the cursor does not display. However when you start typing, content is entered into the editor.

comment:3 Changed 13 years ago by Jakub Ś

Keywords: IE9 IE8 added
Status: pendingconfirmed
Version: 3.6.4 (SVN - trunk)3.6.3

Reproducible in IE8 and IE9 from CKEditor 3.6.3 rev. [7374]

comment:4 Changed 13 years ago by Garry Yao

Status: confirmedpending

Unable to reproduce the issue on trunk.

Changed 13 years ago by Jakub Ś

Attachment: ierr.html added

comment:5 Changed 13 years ago by Jakub Ś

Status: pendingconfirmed

Put ierr.html into ckeditor_trunk/_samples/ and follow steps described in that file.

Changed 13 years ago by Jakub Ś

Attachment: 2012-06-25_1217.swf added

comment:6 Changed 13 years ago by Jakub Ś

Still with ierr.html sample when you click in editor you can't see cursor and js error occurs when executing steps from TC. Check out jing video.

Changed 13 years ago by Garry Yao

Attachment: 9034_2.patch added

comment:7 Changed 13 years ago by Garry Yao

Component: GeneralCore : Selection
Keywords: IE7 added; IE9 IE8 IBM removed
Milestone: CKEditor 3.6.4
Owner: set to Garry Yao
Status: confirmedreview

We should be performing a browser version check instead of a document mode check for the fix in place.

comment:8 Changed 12 years ago by Frederico Caldeira Knabben

Status: reviewreview_failed

I have no difference with the patch on the provided tc file when testing it with IE9. In fact, the proposed code doesn't make any logical change in that case (ie7Compat==true and version==7).

Last edited 12 years ago by Frederico Caldeira Knabben (previous) (diff)

comment:9 Changed 12 years ago by Garry Yao

Resolution: fixed
Status: review_failedclosed

It looks like try...catch is the only rescue to it, fixed with [7521].

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