* khtml/rendering/bidi.cpp:
(khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
skipping after a clean line break, in addition to the cases already
checked for.
* layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
* layout-tests/editing/inserting/insert-br-007.html: Added.
* layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
* layout-tests/editing/inserting/insert-br-008.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7846
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /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 784x84 [border: (2px solid #FF0000)]
+ RenderInline {SPAN} at (0,0) size 37x56
+ RenderText {TEXT} at (14,14) size 32x28
+ text run at (14,14) width 32: "foo"
+ RenderBR {BR} at (0,0) size 0x0
+ RenderText {TEXT} at (14,42) size 37x28
+ text run at (14,42) width 37: " bar"
+ RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream: position 1 of child 2 {BR} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 3; i++)
+ moveSelectionForwardByCharacterCommand();
+ insertNewlineCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo bar</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
--- /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 784x84 [border: (2px solid #FF0000)]
+ RenderBR {BR} at (14,14) size 0x28
+ RenderText {TEXT} at (14,42) size 38x28
+ text run at (14,42) width 38: " foo"
+selection is CARET:
+start: position 1 of child 2 {TEXT} of child 1 {DIV} of root {BODY}
+upstream: position 1 of child 2 {TEXT} of child 1 {DIV} of root {BODY}
+downstream: position 1 of child 2 {TEXT} of child 1 {DIV} of root {BODY}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ insertNewlineCommand();
+ typeCharacterCommand(" ");
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body id="root">
+<div contenteditable id="test" class="editing">foo</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
+2004-10-15 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by Hyatt
+
+ * khtml/rendering/bidi.cpp:
+ (khtml::RenderBlock::skipNonBreakingSpace): Also need to forego the
+ skipping after a clean line break, in addition to the cases already
+ checked for.
+ * layout-tests/editing/inserting/insert-br-007-expected.txt: Added.
+ * layout-tests/editing/inserting/insert-br-007.html: Added.
+ * layout-tests/editing/inserting/insert-br-008-expected.txt: Added.
+ * layout-tests/editing/inserting/insert-br-008.html: Added.
+
=== Safari-167 ===
2004-10-14 Ken Kocienda <kocienda@apple.com>
if (it.obj->style()->nbspMode() != SPACE || it.current().unicode() != nonBreakingSpace)
return false;
- // Do not skip a non-breaking spaces if it is the first character
+ // Do not skip a non-breaking space if it is the first character
// on the first line of a block.
- return !m_firstLine || !isLineEmpty;
+ if (m_firstLine && isLineEmpty)
+ return false;
+
+ // Do not skip a non-breaking space if it is the first character
+ // on a line after a clean line break.
+ if (!m_firstLine && isLineEmpty && previousLineBrokeCleanly)
+ return false;
+
+ return true;
}
int RenderBlock::skipWhitespace(BidiIterator &it, BidiState &bidi)