From 372727e65c03bd4c7d25908db735a2237a6c44d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Kup=C5=9B?= Date: Tue, 20 Oct 2015 11:41:35 +0200 Subject: [PATCH 1/4] Checking if iframe's parent is present in detach() method. --- plugins/wysiwygarea/plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index 81b8a1d8357..e07d4c8fb7d 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -518,7 +518,10 @@ doc.getDocumentElement().clearCustomData(); CKEDITOR.tools.removeFunction( this._.frameLoadedHandler ); - if ( iframe ) { + // #13850 - On IE, iframe is returned even after remove() method is called on it. + // Checking if parent is present fixes this issue. + if ( iframe && iframe.getParent() ) { + iframe.clearCustomData(); onResize = iframe.removeCustomData( 'onResize' ); onResize && onResize.removeListener(); From f96723d48107578aa5bc15379cd4ea37e048e678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Kup=C5=9B?= Date: Thu, 22 Oct 2015 16:34:22 +0200 Subject: [PATCH 2/4] Added try/catch block over window.getFrame() call - fix for Edge throwing an exception when trying to access window.frameElement property. --- plugins/wysiwygarea/plugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index e07d4c8fb7d..50fd8c71c5d 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -508,9 +508,15 @@ detach: function() { var editor = this.editor, doc = editor.document, - iframe = editor.window.getFrame(), + iframe, onResize; + // #13850, #13790 - trying to access window's frameElement property on Edge throws an exception + // in situation when frame was already removed from DOM. + try { + iframe = editor.window.getFrame(); + } catch ( e ) {} + framedWysiwyg.baseProto.detach.call( this ); // Memory leak proof. From 005e3dedff1bf607a897d00c843dee87abe12fda Mon Sep 17 00:00:00 2001 From: "m.lewandowski" Date: Wed, 21 Oct 2015 09:38:13 +0200 Subject: [PATCH 3/4] Code style: removed empty line. --- plugins/wysiwygarea/plugin.js | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index 50fd8c71c5d..28e914101f3 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -527,7 +527,6 @@ // #13850 - On IE, iframe is returned even after remove() method is called on it. // Checking if parent is present fixes this issue. if ( iframe && iframe.getParent() ) { - iframe.clearCustomData(); onResize = iframe.removeCustomData( 'onResize' ); onResize && onResize.removeListener(); From 2b3093b93689c9c8bf67740a5754dad5fd52d4c4 Mon Sep 17 00:00:00 2001 From: "m.lewandowski" Date: Fri, 23 Oct 2015 11:13:40 +0200 Subject: [PATCH 4/4] Updated comments. --- plugins/wysiwygarea/plugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index 28e914101f3..587418157fc 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -511,8 +511,8 @@ iframe, onResize; - // #13850, #13790 - trying to access window's frameElement property on Edge throws an exception - // in situation when frame was already removed from DOM. + // Trying to access window's frameElement property on Edge throws an exception + // when frame was already removed from DOM. (#13850, #13790) try { iframe = editor.window.getFrame(); } catch ( e ) {} @@ -524,8 +524,8 @@ doc.getDocumentElement().clearCustomData(); CKEDITOR.tools.removeFunction( this._.frameLoadedHandler ); - // #13850 - On IE, iframe is returned even after remove() method is called on it. - // Checking if parent is present fixes this issue. + // On IE, iframe is returned even after remove() method is called on it. + // Checking if parent is present fixes this issue. (#13850) if ( iframe && iframe.getParent() ) { iframe.clearCustomData(); onResize = iframe.removeCustomData( 'onResize' );