Ticket #9093 (confirmed Bug)

Opened 22 months ago

Last modified 22 months ago

Enter command is broken (different behavior between browsers)

Reported by: Reinmar Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description (last modified by j.swiderski) (diff)

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

Firefox.png (66.1 KB) - added by j.swiderski 22 months ago.
chrome.png (67.5 KB) - added by j.swiderski 22 months ago.

Change History

comment:1 Changed 22 months ago by j.swiderski

  • Version 3.6.4 (SVN - trunk) deleted

comment:2 Changed 22 months ago by j.swiderski

  • Status changed from new to confirmed
  • Version set to 3.0
  • Description modified (diff)

Changed 22 months ago by j.swiderski

Changed 22 months ago by j.swiderski

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