--- /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 784x240 [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/3977962>"
+ RenderText {TEXT} at (422,28) size 749x56
+ text run at (422,28) width 327: " font loses bold style after pasting"
+ text run at (0,56) width 384: "next to existing text and pressing return"
+ RenderBlock {DIV} at (14,114) size 756x112
+ RenderBlock (anonymous) at (0,0) size 756x56
+ 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 436x28
+ text run at (0,28) width 436: "Should see this content in the red box below:"
+ RenderBlock {DIV} at (0,56) size 756x56
+ RenderBlock (anonymous) at (0,0) size 756x28
+ RenderText {TEXT} at (0,0) size 32x28
+ text run at (0,0) width 32: "foo"
+ RenderBlock {DIV} at (0,28) size 756x28
+ RenderInline {B} at (0,0) size 36x28
+ RenderText {TEXT} at (0,0) size 36x28
+ text run at (0,0) width 36: "bar"
+ RenderBlock {DIV} at (0,264) size 784x60
+ RenderBlock {DIV} at (0,0) size 784x60 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (2,2) size 780x28
+ RenderText {TEXT} at (0,0) size 32x28
+ text run at (0,0) width 32: "foo"
+ RenderInline {B} at (0,0) size 0x28
+ RenderBlock {DIV} at (2,30) size 780x28
+ RenderInline {B} at (0,0) size 36x28
+ RenderText {TEXT} at (0,0) size 36x28
+ text run at (0,0) width 36: "bar"
+selection is CARET:
+start: position 0 of child 1 {TEXT} of child 1 {B} of child 2 {DIV} of child 1 {DIV} of root {DIV}
+upstream: position 0 of child 2 {DIV} of child 1 {DIV} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 1 {B} of child 2 {DIV} 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 < 3; i++)
+ moveSelectionForwardByCharacterCommand();
+ insertParagraphCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+
+<div class="explanation">
+<div class="scenario">
+Tests:
+<br>
+Fix for this bug:
+<a href="rdar://problem/3977962"><rdar://problem/3977962></a> font loses bold style after pasting next to existing text and pressing return
+</div>
+<div class="expected-results">
+Expected Results:
+<br>
+Should see this content in the red box below: <div>foo<div><b>bar</b></div></div>
+</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"><div>foo<b>bar</b></div></div>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
+2005-02-23 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3977962> font loses bold style after pasting next to existing text and pressing return
+
+ * khtml/editing/htmlediting.cpp:
+ (khtml::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Problem here was
+ that we were doing work in cases where we should not, and content whose style would have
+ been correct if we had done nothing was getting clobbered. It turns out that extra work
+ to apply style to the new paragraph added in this command only needs to be done if we're
+ at the boundaries of a paragraph. Otherwise, content that is moved as part of the work
+ of the command will lend their styles to the new paragraph without any extra work needed.
+ So, make this position check and return unless at a paragraph boundary.
+
+ New test:
+
+ * layout-tests/editing/style/block-styles-007-expected.txt
+ * layout-tests/editing/style/block-styles-007.html
+
2005-02-23 Ken Kocienda <kocienda@apple.com>
Reviewed by Hyatt