File tree Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 898
898
ieFunctionKeysWorkaround = CKEDITOR . env . ie && keyCode in backspaceOrDelete ;
899
899
900
900
// 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 ) {
903
903
if ( this . lastKeydownImage . equalsContent ( new Image ( editor , true ) ) ) {
904
904
// Content was not changed, we don't need to do anything.
905
905
return ;
Original file line number Diff line number Diff line change
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
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments