Skip to content

Commit 1ba5105

Browse files
committed
Merge branch 't/12327'
2 parents 67f620b + 88b575f commit 1ba5105

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

plugins/undo/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,8 @@
898898
ieFunctionKeysWorkaround = CKEDITOR.env.ie && keyCode in backspaceOrDelete;
899899

900900
// IE: doesn't call keypress for backspace/del keys so we need to handle it manually
901-
// with a workaround.
902-
if ( ieFunctionKeysWorkaround ) {
901+
// with a workaround. Also we need to be aware that lastKeydownImage might not be available (#12327).
902+
if ( ieFunctionKeysWorkaround && this.lastKeydownImage ) {
903903
if ( this.lastKeydownImage.equalsContent( new Image( editor, true ) ) ) {
904904
// Content was not changed, we don't need to do anything.
905905
return;

tests/plugins/undo/integrations.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* bender-tags: editor,unit */
2+
/* bender-ckeditor-plugins: undo,image */
3+
/* bender-include: _helpers/tools.js */
4+
5+
( function() {
6+
'use strict';
7+
8+
bender.editor = true;
9+
10+
var keyCodesEnum, // keyCodesEnum will be inited in first setUp call.
11+
tcs = {
12+
setUp: function() {
13+
// Inits tools used to mimic events if needed.
14+
if ( !this.tools ) {
15+
this.tools = undoEventDispatchTestsTools( this );
16+
// Alias for more convenient accesss.
17+
this.keyTools = this.tools.key;
18+
keyCodesEnum = this.keyTools.keyCodesEnum;
19+
}
20+
21+
this.undoManager = this.editor.undoManager;
22+
23+
// For each TC we want to reset undoManager.
24+
this.undoManager.reset();
25+
// Force to reset inputFired counter, as some TCs may produce leftovers.
26+
this.undoManager.editingHandler.resetCounter();
27+
},
28+
29+
// (#12327)
30+
'test image deletion': function() {
31+
bender.tools.selection.setWithHtml( this.editor, '<p>[<img src="%BASE_PATH%_assets/img.gif" />]Apollo 11</p>' );
32+
this.keyTools.keyEvent( keyCodesEnum.BACKSPACE, null, true );
33+
// TC should not cause any exception.
34+
assert.isTrue( true );
35+
}
36+
};
37+
38+
bender.test( tcs );
39+
} )();

0 commit comments

Comments
 (0)