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 784x56 [border: (2px solid #FF0000)]
- RenderInline {SPAN} at (0,0) size 44x28
- RenderText {TEXT} at (14,14) size 44x28
- text run at (14,14) width 44: "xfoo"
- RenderText {TEXT} at (58,14) size 6x28
- text run at (58,14) width 6: " "
- RenderBR {BR} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
+ RenderInline {SPAN} at (0,0) size 44x56
+ RenderBR {BR} at (14,14) size 0x28
+ RenderText {TEXT} at (14,42) size 44x28
+ text run at (14,42) width 44: "xfoo"
+ RenderText {TEXT} at (0,0) size 0x0
selection is CARET:
-start: position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
-upstream: position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
-downstream: position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+start: position 1 of child 2 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream: position 1 of child 2 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 1 of child 2 {TEXT} of child 1 {SPAN} of root {DIV}
+2004-08-31 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3782521> Typing newline at start of block does not work
+
+ * khtml/editing/htmlediting_impl.cpp:
+ (khtml::InputNewlineCommandImpl::doApply): Change handling of case to insert
+ newline at the start of a block.
+ * layout-tests/editing/inserting/insert-br-006-expected.txt: Updated layout test with
+ new results.
+
2004-08-31 Ken Kocienda <kocienda@apple.com>
Reviewed by me
}
else if (atStart) {
LOG(Editing, "input newline case 2");
- // Insert node, but place the caret into index 0 of the downstream
- // position. This will make the caret appear after the break, and as we know
- // there is content at that location, this is OK.
- insertNodeBeforePosition(nodeToInsert, pos);
- setEndingSelection(Position(pos.node(), pos.node()->caretMinOffset()));
+ // Insert node before downstream position, and place caret there as well.
+ Position endingPosition = pos.downstream(StayInBlock);
+ insertNodeBeforePosition(nodeToInsert, endingPosition);
+ setEndingSelection(endingPosition);
}
else if (atEnd) {
LOG(Editing, "input newline case 3");