Opened 13 years ago
Last modified 13 years ago
#9093 confirmed Bug
Enter command is broken (different behavior between browsers) — at Initial Version
Reported by: | Piotrek Koszuliński | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0 |
Keywords: | Cc: |
Description
TC1
- Open replacebyclass sample.
- Set content:
<p>aaa</p><p>bbb</p><p>ccc</p>
. - Select second paragraph (with mouse or keyboard).
- 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> </p><p>^ </p><p>ccc</p>
Actual: Ok on Firefox, ok on IE8, broken on Chrome and Opera - they only removes content of paragraph, without creating new one.
TC2 (Webkit only)
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.
Expected content: <p>aaa</p><p>^ </p><p>ccc</p>
Actual: Accidentally it works like this now, but that's probably caused by incorrect TC1 handling, so shouldn't be fixed with it.
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.
Expected content: <p>aaa</p><p> </p><p>^ccc</p>
TC4
I've got completely ridiculous results (opposite to manual testing) when running these TCs:
'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> </p><p> </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"> </p><p dir="rtl"> </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"> </p><p dir="rtl"> </p><p dir="rtl" id="target">bar</p>', bot.getData( false, true ) ); }