Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5680)
+++ /CKEditor/trunk/CHANGES.html (revision 5681)
@@ -62,4 +62,5 @@
#5943 : An error is no longer generated when using percent or pixel values in the image dialog.
#5951 : Avoid problems with security systems due to the usage of UniversalXPConnect.
+ #5441 : Avoid errors if the editor instance is removed from the DOM before calling its destroy() method.
Index: /CKEditor/trunk/_source/plugins/elementspath/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/elementspath/plugin.js (revision 5680)
+++ /CKEditor/trunk/_source/plugins/elementspath/plugin.js (revision 5681)
@@ -134,5 +134,7 @@
editor.on( 'contentDomUnload', function()
{
- getSpaceElement().setHtml( emptyHtml );
+ // If the spaceElement hasn't been initialized, don't try to do it at this time
+ // Only reuse existing reference.
+ spaceElement && spaceElement.setHtml( emptyHtml );
});
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js (revision 5680)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js (revision 5681)
@@ -1,3 +1,3 @@
-/*
+/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -798,4 +798,11 @@
iframe.clearCustomData();
+
+ /*
+ * IE BUG: When destroying editor DOM with the selection remains inside
+ * editing area would break IE7/8's selection system, we have to put the editing
+ * iframe offline first. (#3812 and #5441)
+ */
+ iframe.remove();
},
Index: /CKEditor/trunk/_source/themes/default/theme.js
===================================================================
--- /CKEditor/trunk/_source/themes/default/theme.js (revision 5680)
+++ /CKEditor/trunk/_source/themes/default/theme.js (revision 5681)
@@ -234,26 +234,4 @@
editor.element.clearCustomData();
- /*
- * IE BUG: Removing the editor DOM elements while the selection is inside
- * the editing area would break IE7/8's selection system. So we need to put
- * the selection back to the parent document without scrolling the window.
- * (#3812)
- */
- if ( CKEDITOR.env.ie )
- {
- container.setStyle( 'display', 'none' );
-
- var $range = document.body.createTextRange();
- $range.moveToElementText( container.$ );
- try
- {
- // Putting the selection to a display:none element - this will certainly
- // fail. But! We've just put the selection document back to the parent
- // document without scrolling the window!
- $range.select();
- }
- catch ( e ) {}
- }
-
if ( container )
container.remove();