Ticket #9034 (closed Bug: fixed)

Opened 23 months ago

Last modified 22 months ago

IE: Unspecified Error when making a selection in the editor

Reported by: tmonahan Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.6.4
Component: Core : Selection Version: 3.6.3
Keywords: IE7 Cc: damo, satya

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

9034.patch (1.2 KB) - added by tmonahan 23 months ago.
Proposed fix
IE unspecified error.html (938 bytes) - added by tmonahan 22 months ago.
ierr.html (904 bytes) - added by j.swiderski 22 months ago.
2012-06-25_1217.swf (409.9 KB) - added by j.swiderski 22 months ago.
9034_2.patch (818 bytes) - added by garry.yao 22 months ago.

Change History

Changed 23 months ago by tmonahan

Proposed fix

comment:1 Changed 23 months ago by fredck

  • Status changed from new to pending

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 22 months ago by tmonahan

comment:2 Changed 22 months ago by tmonahan

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 22 months ago by j.swiderski

  • Status changed from pending to confirmed
  • Keywords IE9 IE8 added
  • Version changed from 3.6.4 (SVN - trunk) to 3.6.3

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

comment:4 Changed 22 months ago by garry.yao

  • Status changed from confirmed to pending

Unable to reproduce the issue on trunk.

Changed 22 months ago by j.swiderski

comment:5 Changed 22 months ago by j.swiderski

  • Status changed from pending to confirmed

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

Changed 22 months ago by j.swiderski

comment:6 Changed 22 months ago by j.swiderski

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 22 months ago by garry.yao

comment:7 Changed 22 months ago by garry.yao

  • Owner set to garry.yao
  • Keywords IE7 added; IE9 IE8 IBM removed
  • Component changed from General to Core : Selection
  • Status changed from confirmed to review
  • Milestone set to CKEditor 3.6.4

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

comment:8 Changed 22 months ago by fredck

  • Status changed from review to review_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 22 months ago by fredck (previous) (diff)

comment:9 Changed 22 months ago by garry.yao

  • Status changed from review_failed to closed
  • Resolution set to fixed

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

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