Skip to content
Permalink
Browse files

Merge branch 't/13344'

  • Loading branch information...
Reinmar committed Jun 11, 2015
2 parents 5f9e21c + bb29482 commit e857553faef8a4e92e4be8c1a10394d5a9a3a9bb
@@ -24,6 +24,7 @@ Fixed Issues:
* [#13164](http://dev.ckeditor.com/ticket/13164): Fixed: Error when inserting a hidden field.
* [#13155](http://dev.ckeditor.com/ticket/13155): Fixed: Incorrect [Line Utilities](http://ckeditor.com/addon/lineutils) positioning when `<body>` has a margin.
* [#13351](http://dev.ckeditor.com/ticket/13351): Fixed: Link lost when editing linked image with the link tab disabled. Also, fixed a bug when inserting an image into fully selected link would throw an error ([#12847](https://dev.ckeditor.com/ticket/12847)).
* [#13344](http://dev.ckeditor.com/ticket/13344): [Webkit/Blink] Fixed: It is possible to remove/change editor contents in readonly mode.

Other Changes:

@@ -906,6 +906,10 @@
// blocks on BACKSPACE/DEL (#11861,#9998).
if ( CKEDITOR.env.webkit ) {
this.attachListener( editor, 'key', function( evt ) {
if ( editor.readOnly ) {
return true;
}

// Use getKey directly in order to ignore modifiers.
// Justification: http://dev.ckeditor.com/ticket/11861#comment:13
var key = evt.data.domEvent.getKey();
@@ -59,6 +59,18 @@
} );
},

'test backspace on two paragraphs in read-only mode': function() {
this.editor.setReadOnly( true );

try {
bf( '<p>Test</p><p>^Test</p>', '<p>Test</p><p>^Test</p>' ).call( this );
} catch ( e ) {
throw e;
} finally {
this.editor.setReadOnly( false );
}
},

'test CTRL+backspace works as backspace when merging blocks': assertKeystroke( BACKSPACE, CKEDITOR.CTRL, 0, '<p>x</p><p>^y</p>', '<p>x^y</p>' ),
'test SHIFT+backspace works as backspace when merging blocks': assertKeystroke( BACKSPACE, CKEDITOR.SHIFT, 0, '<p>x</p><p>^y</p>', '<p>x^y</p>' ),
'test CTRL+delete works as delete when merging blocks': assertKeystroke( DEL, CKEDITOR.CTRL, 0, '<p>x^</p><p>y</p>', '<p>x^y</p>' ),
@@ -2,7 +2,7 @@
/* bender-ckeditor-plugins: list,table,undo */
/* global quirksTools */

( function( bd, bdf, b ) {
( function( bd, bdf, b, df ) {
'use strict';

bender.editor = {
@@ -48,6 +48,18 @@
} );
},

'test delete on two paragraphs in read-only mode': function() {
this.editor.setReadOnly( true );

try {
df( '<p>[Test</p><p>Test]</p>', '<p>[Test</p><p>Test]</p>' ).call( this );
} catch ( e ) {
throw e;
} finally {
this.editor.setReadOnly( false );
}
},

'test backspace and delete #1': bd( '<p>xx[x</p><p>y]yy</p>', '<p>xx^yy</p>' ),
'test backspace and delete #2': bd( '<div>xx[x</div><div>y]yy</div>', '<div>xx^yy</div>' ),
'test backspace and delete #3': bd( '<p>x<strong>x[x</strong></p><p>y]yy</p>', '<p>x<strong>x^</strong>yy</p>' ),
@@ -87,4 +99,6 @@
'test backspace and delete, no action #5': bdf( '<p>x[xy]y</p>' ),
'test backspace and delete, no action #6': bdf( '<table><tbody><tr><td>x[x</td></tr></tbody></table><table><tbody><tr><td>y]y</td></tr></tbody></table>' )
} );
} )( quirksTools.bd, quirksTools.bdf, quirksTools.b );


} )( quirksTools.bd, quirksTools.bdf, quirksTools.b, quirksTools.df );
@@ -0,0 +1,15 @@
<div id="editor">
<h1>TC1:</h1>
<p>Foo [bar</p>
<p>Bom] bom</p>

<h1>TC2:</h1>
<p>^Foo bar</p>
</div>

<script>
CKEDITOR.replace( 'editor', {
readOnly: true,
height: 500
} );
</script>
@@ -0,0 +1,17 @@
@bender-tags: 4.4.8, tc, 13344
@bender-ui: collapsed
@bender-ckeditor-plugins: toolbar, format, wysiwygarea

Note: Editor is in the read-only mode.

## TC1:

1. Make selection as shown with `[ ]`.
2. Press *Delete/Backspace*.
3. Nothing should happen.

## TC2:

1. Click before `^` (as you would like to make a selection there).
2. Press *Delete/Backspace*.
3. Nothing should happen.

0 comments on commit e857553

Please sign in to comment.
You can’t perform that action at this time.