Opened 15 years ago
Closed 10 years ago
#5659 closed Bug (worksforme)
Selection plugin keeps crashing
Reported by: | Antti Leppä | Owned by: | |
---|---|---|---|
Priority: | Low | Milestone: | |
Component: | General | Version: | 3.2.1 |
Keywords: | Cc: |
Description
CKEditor keeps crashing in background with Firefox because selection plugin uses "tryThese" to check if browser supports "createRange" function.
Crashing can be avoided by refactoring code to use typeof operator instead of tryThese.
plugins/selection/plugin.js:743
var self = this; var node = CKEDITOR.tools.tryThese( // Is it native IE control type selection? function() { return self.getNative().createRange().item( 0 ); }, // Figure it out by checking if there's a single enclosed // node of the range. function() { var range = self.getRanges()[ 0 ]; range.shrink( CKEDITOR.SHRINK_ELEMENT ); var enclosed; if ( range.startContainer.equals( range.endContainer ) && ( range.endOffset - range.startOffset ) == 1 && styleObjectElements[ ( enclosed = range.startContainer.getChild( range.startOffset ) ).getName() ] ) { return enclosed.$; } });
Would be replaced with:
var node = null; // Is it native IE control type selection? if (this.getNative() && (typeof this.getNative().createRange == "function")) { node = this.getNative().createRange().item( 0 ); } else { var range = this.getRanges()[ 0 ]; range.shrink( CKEDITOR.SHRINK_ELEMENT ); var enclosed; if ( range.startContainer.equals( range.endContainer ) && ( range.endOffset - range.startOffset ) == 1 && styleObjectElements[ ( enclosed = range.startContainer.getChild( range.startOffset ) ).getName() ] ) { node = enclosed.$; } }
The bug was discovered with Firefox 3.5.9 (Firebug 1.5.4) / Linux 64bit
Attachments (3)
Change History (6)
comment:1 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
Encountered the same on IE 11
Changed 10 years ago by
Attachment: | ie11_version.png added |
---|
Changed 10 years ago by
Changed 10 years ago by
Attachment: | self_getNative.png added |
---|
comment:3 Changed 10 years ago by
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
Uh, turned out I had IE debugger configured to break on all exceptions.
I was not able to crash editor in 64-bit Linux using latest CKEditor 3.6.2
This post is 2 years old and "tryThese" has changed the lot. Look like this has expired.
If anyone is able to reproduce it please reopen this ticket.