From 180559d11e03d2775892926a73fd822eb85100ac Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 24 Jun 2015 14:19:33 +0200 Subject: [PATCH 1/4] Tests: Added test for pasting a widget with a copybin, the way IE8 tends to do. --- tests/plugins/widget/widgetsintegration.js | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/plugins/widget/widgetsintegration.js b/tests/plugins/widget/widgetsintegration.js index 5aaa204ce1f..7b193554425 100644 --- a/tests/plugins/widget/widgetsintegration.js +++ b/tests/plugins/widget/widgetsintegration.js @@ -668,6 +668,47 @@ } ); }, + // #13460 + 'test pasting a widget with lots of extra markup and mixed HTML case': function() { + var editor = this.editor; + + this.editorBot.setData( '

AAB

', function() { + var widget = getWidgetById( editor, 'w1' ), + html = widget.wrapper.getOuterHtml(); + + editor.widgets.del( widget ); + + editor.focus(); + + var range = editor.createRange(); + range.setStartAt( editor.document.getById( 'p1' ), CKEDITOR.POSITION_BEFORE_END ); + range.collapse( true ); + range.select(); + + editor.once( 'afterPaste', function() { + resume( function() { + var widget = getWidgetById( editor, 'w1' ); + + assert.isTrue( !!widget, 'widget was pasted' ); + assert.areSame( '

ABA

', editor.getData() ); + assert.isTrue( !!editor.getSelection().isFake, 'widget is selected' ); + assert.areSame( widget.wrapper, editor.getSelection().getSelectedElement(), 'widget is selected - element' ); + } ); + } ); + + // Ensure async. + wait( function() { + editor.execCommand( 'paste', + '' + + '\u200b' + + html + + '\u200b' + + '' + ); + } ); + } ); + }, + 'test copying widget with context': function() { var editor = this.editor; From d273aa5afe58deb46162ebe3e56a103dc956cdc2 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Wed, 24 Jun 2015 13:40:55 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Fixed:=20Broken=20copy=E2=80=93paste=20of?= =?UTF-8?q?=20inline=20widgets.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/widget/plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/widget/plugin.js b/plugins/widget/plugin.js index fb6ffd636ac..a27baa94869 100644 --- a/plugins/widget/plugin.js +++ b/plugins/widget/plugin.js @@ -2334,7 +2334,9 @@ ']*data-cke-copybin-start="1"[^>]*>.?([\\s\\S]+)]*data-cke-copybin-end="1"[^>]*>.?' + '(?:)?' + '(?:)?' + - '$' + '$', + // IE8 prefers uppercase when browsers stick to lowercase HTML (#13460). + 'i' ); function pasteReplaceFn( match, wrapperHtml ) { From 74529ba0138952cae65e71a6dfce488625e6a5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Tue, 7 Jul 2015 11:50:14 +0200 Subject: [PATCH 3/4] Tests: Tag and minor fix. --- tests/plugins/widget/widgetsintegration.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/plugins/widget/widgetsintegration.js b/tests/plugins/widget/widgetsintegration.js index 7b193554425..752a131b2d0 100644 --- a/tests/plugins/widget/widgetsintegration.js +++ b/tests/plugins/widget/widgetsintegration.js @@ -1,4 +1,4 @@ -/* bender-tags: widgetcore */ +/* bender-tags: widgetcore, 13460 */ /* bender-include: _helpers/tools.js */ /* global widgetTestsTools */ @@ -691,8 +691,7 @@ assert.isTrue( !!widget, 'widget was pasted' ); assert.areSame( '

ABA

', editor.getData() ); - assert.isTrue( !!editor.getSelection().isFake, 'widget is selected' ); - assert.areSame( widget.wrapper, editor.getSelection().getSelectedElement(), 'widget is selected - element' ); + assert.areSame( widget, editor.widgets.focused, 'widget is selected' ); } ); } ); From 57b437bbc037b2fc7057ec26b8aefd7a0219895b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Koszuli=C5=84ski?= Date: Tue, 7 Jul 2015 11:52:54 +0200 Subject: [PATCH 4/4] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 16739a73212..e2b457bc267 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Fixed Issues: * [#13129](http://dev.ckeditor.com/ticket/13129) Fixed: Block widget blurred after drop followed by undo. * [#13468](http://dev.ckeditor.com/ticket/13468): [IE] Fixed: Binding drag&drop `dataTransfer` does not work if `text` data was set in the meantime. * [#13419](http://dev.ckeditor.com/ticket/13419): Fixed: [Auto Link](http://ckeditor.com/addon/autolink) plugin does not encode double quotes in URLs. +* [#13460](http://dev.ckeditor.com/ticket/13460): [IE8] Fixed: Copying inline widgets is broken when the Advanced Content Filter is disabled. ## CKEditor 4.5.1