Opened 5 years ago

Last modified 5 years ago

#9093 confirmed Bug

Enter command is broken (different behavior between browsers)

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description (last modified by Jakub Ś)

TC1

  1. Open replacebyclass sample.
  2. Set content: <p>aaa</p><p>bbb</p><p>ccc</p>.
  3. Select second paragraph (with mouse or keyboard).
  4. Press enter.

Expected: when EOL visually not selected (visual EOL selection is possible only on Webkits) enter command should remove content of selected paragraph (leaving the tag) and then create new one below.

Expected content: <p>aaa</p><p>&nbsp;</p><p>^&nbsp;</p><p>ccc</p>

Actual: Ok on Firefox, ok on IE, Visually broken on Chrome and Opera. They remove content of paragraph and create new one but this new paragraph is not visible (See image). Only after you switch to source and back second paragraph is visually added.

TC2

Steps as in TC1. but select with EOL preceding second paragraph.

Expected: EOL is selected, so delete it with the content (move caret to <p>aaa^</p> and then create new paragraph. I’m not sure why but this can be reproduced in all browsers – Just select {{{a bbb}} and press SHIFT+right arrow.

Expected content: <p>aaa</p><p>^&nbsp;</p><p>ccc</p>

Actual: Visually it works in all browsers but if you switch to source and back you will see that new extra paragraph is added. All browsers delete contents of existing paragraph and add new one (Can be checked with E.g. Firebug) but it is only visible when switching to source and back.

TC3 (Webkit only)

Steps as in TC1. but select with EOL succeeding second paragraph.

Expected: EOL is selected, so delete it with the content (move caret to <p>^ccc</p> and then create new paragraph. I’m not sure why but this can be reproduced in all browsers – Just select {{{a bbb}} and press SHIFT+right arrow.

Expected content: <p>aaa</p><p>&nbsp;</p><p>^ccc</p>

Actual: Visually it works in all browsers but if you switch to source and back you will see that new extra paragraph is added. All browsers delete contents of existing paragraph and add new one (Can be checked with E.g. Firebug) but it is only visible when switching to source and back.

TC4

I've got the following results when running these TCs (The same as for manual tests):

'test Enter key for paragraphs 1' : function()
{
	var bot = this.editorBot;
	bot.setHtmlWithSelection( '<p>bam</p><p>[foo]</p><p>bar</p>' );
	bot.execCommand( 'enter' );

	assert.areSame( '<p>bam</p><p>&nbsp;</p><p>&nbsp;</p><p>bar</p>', bot.getData( false, true ) );
},

'test Enter key for paragraphs 2a' : function()
{
	var bot = this.editorBot;
	bot.setHtmlWithSelection( '<p>bam</p>[<p dir="rtl">foo</p>]<p dir="rtl" id="target">bar</p>' );
	bot.execCommand( 'enter' );

	assert.areSame( '<p>bam</p><p dir="rtl">&nbsp;</p><p dir="rtl">&nbsp;</p><p dir="rtl" id="target">bar</p>', bot.getData( false, true ) );
},

'test Enter key for paragraphs 2b' : function()
{
	var bot = this.editorBot;
	bot.setHtmlWithSelection( '[<p dir="rtl">foo</p>]<p dir="rtl" id="target">bar</p>' );
	bot.execCommand( 'enter' );

	assert.areSame( '<p dir="rtl">&nbsp;</p><p dir="rtl">&nbsp;</p><p dir="rtl" id="target">bar</p>', bot.getData( false, true ) );
}

Attachments (2)

Firefox.png (66.1 KB) - added by Jakub Ś 5 years ago.
chrome.png (67.5 KB) - added by Jakub Ś 5 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by Jakub Ś

Version: 3.6.4 (SVN - trunk)

comment:2 Changed 5 years ago by Jakub Ś

Description: modified (diff)
Status: newconfirmed
Version: 3.0

Changed 5 years ago by Jakub Ś

Attachment: Firefox.png added

Changed 5 years ago by Jakub Ś

Attachment: chrome.png added
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy