Opened 12 years ago

Last modified 12 years ago

#9501 confirmed Bug

Find selection throws error on cut in IE6-8

Reported by: Jon Sykes Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description (last modified by Jakub Ś)

Steps To Reproduce:

  1. Go to the demo page in IE6 or IE7 or IE8.
  2. Clear the content in the editor.
  3. Type:
    foo bar
    boo far
    
  4. Click on find icon
  5. type foo into the find field
  6. click find (foo will become selected)
  7. click cancel in the find dialog
  8. click 'cut' icon in ckeditor
  9. (accept the permissions if the browser asks)
  10. Error Invalid Argument gets thrown.

Looks like it's some issue with getting nodeValue (for nodeValue.length) within the GetRanges function of the selection plugin.

// Start the measuring until distance overflows, meanwhile count the text nodes.
var i = siblings.length;
while ( distance > 0 && i > 0 )
{
	sibling = siblings[ --i ];
	if ( sibling.nodeType == CKEDITOR.NODE_TEXT )
	{
		container = sibling;
		distance -= sibling.nodeValue.length;  <----- this line throws the error
	}
}

Same error occurs if you do a find a replace for foo then close the dialog and click cut.

Change History (2)

comment:1 Changed 12 years ago by Jakub Ś

Description: modified (diff)
Keywords: getranges find replace removed
Summary: Find selection throws error on cut in IE7/IE8Find selection throws error on cut in IE6-8

comment:2 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.43.0

Problem can be reproduced in IE6-8 from CKEditor 3.0.

In editor 3.0 you have to put cursor before foo so that find dialog could find it :).

JS error is:
Message: invalid argument
Line: 973
URI: /ckeditor/_source/plugins/selection/plugin.js


I believe the same or similar error is thrown in CKEDitor 4.x (v4) but this version handles this process more gracefully - it displays message that browser doesn't have permissions to cut and CRTL+X should be used. The same thing is happening if you try to cut collapsed selection (Described here #9632).

Last edited 12 years ago by Jakub Ś (previous) (diff)
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