Opened 13 years ago
Last modified 13 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 )
Steps To Reproduce:
- Go to the demo page in IE6 or IE7 or IE8.
- Clear the content in the editor.
- Type:
foo bar boo far
- Click on find icon
- type foo into the find field
- click find (foo will become selected)
- click cancel in the find dialog
- click 'cut' icon in ckeditor
- (accept the permissions if the browser asks)
- 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 13 years ago by
| Description: | modified (diff) |
|---|---|
| Keywords: | getranges find replace removed |
| Summary: | Find selection throws error on cut in IE7/IE8 → Find selection throws error on cut in IE6-8 |
comment:2 Changed 13 years ago by
| Status: | new → confirmed |
|---|---|
| Version: | 3.6.4 → 3.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).