--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x212 [border: (2px solid #0000FF)]
+ RenderBlock {DIV} at (14,14) size 756x84
+ RenderText {TEXT} at (0,0) size 67x28
+ text run at (0,0) width 67: "Tests: "
+ RenderBR {BR} at (0,0) size 0x0
+ RenderText {TEXT} at (0,28) size 162x28
+ text run at (0,28) width 162: "Fix for this bug: "
+ RenderInline {A} at (0,0) size 260x28 [color=#0000EE]
+ RenderText {TEXT} at (162,28) size 260x28
+ text run at (162,28) width 260: "<rdar://problem/4039676>"
+ RenderText {TEXT} at (422,28) size 315x28
+ text run at (422,28) width 315: " REGRESSION (Mail): in reply,"
+ RenderInline {CR} at (0,0) size 708x28
+ RenderText {TEXT} at (0,56) size 708x28
+ text run at (0,56) width 708: "on pasted text (without trailing newline) is eaten when pasted above date"
+ RenderBlock {DIV} at (14,114) size 756x84
+ RenderText {TEXT} at (0,0) size 189x28
+ text run at (0,0) width 189: "Expected Results: "
+ RenderBR {BR} at (0,0) size 0x0
+ RenderText {TEXT} at (0,28) size 708x56
+ text run at (0,28) width 708: "Should see two lines of text below, self-documenting themselves as \"line"
+ text run at (0,56) width 197: "one\" and \"line two\"."
+ RenderBlock {DIV} at (0,236) size 784x60
+ RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
+ RenderText {TEXT} at (2,2) size 78x28
+ text run at (2,2) width 78: "line one"
+ RenderBR {BR} at (0,0) size 0x0
+ RenderText {TEXT} at (2,30) size 79x28
+ text run at (2,30) width 79: "line two"
+selection is CARET:
+start: position 8 of child 1 {TEXT} of child 1 {DIV} of root {DIV}
+upstream: position 8 of child 1 {TEXT} of child 1 {DIV} of root {DIV}
+downstream: position 0 of child 2 {BR} of child 1 {DIV} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ font-size: 24px;
+}
+.explanation {
+ border: 2px solid blue;
+ padding: 12px;
+ font-size: 24px;
+ margin-bottom: 24px;
+}
+.scenario { margin-bottom: 16px;}
+.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
+.expected-results:first-line { font-weight: bold }
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 8; i++)
+ extendSelectionForwardByCharacterCommand();
+ cutCommand();
+ pasteCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+
+<div class="explanation">
+<div class="scenario">
+Tests:
+<br>
+Fix for this bug:
+<a href="rdar://problem/4039676"><rdar://problem/4039676></a> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
+</div>
+<div class="expected-results">
+Expected Results:
+<br>
+Should see two lines of text below, self-documenting themselves as "line one" and "line two".
+</div>
+</div>
+
+<div contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space;">
+<div id="test" class="editing">
+line one<br>line two
+</div>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
+2005-03-07 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/4039676> REGRESSION (Mail): in reply, <cr> on pasted text (without trailing newline) is eaten when pasted above date
+
+ * khtml/editing/htmlediting.cpp:
+ (khtml::ReplaceSelectionCommand::doApply): Code to "eat" a <br> element, that was creating an otherwise empty line, was running
+ when it should not. If the content being pasted in does not end in a "logical" newline itself, then the <br> already
+ in the content needs to be preserved. A simple one-line change now sees to this.
+
+ * layout-tests/editing/pasteboard/paste-text-010-expected.txt: This test now has an extra, but harmless,
+ <br> at the end of a paragraph. This makes sense given the code change.
+
+ New test:
+ * layout-tests/editing/pasteboard/paste-text-018-expected.txt: Added.
+ * layout-tests/editing/pasteboard/paste-text-018.html: Added.
+
2005-03-07 Ken Kocienda <kocienda@apple.com>
Reviewed by John