[webkit-changes] cvs commit: WebCore/khtml/editing
insert_text_command.cpp markup.cpp
David
harrison at opensource.apple.com
Wed Jun 29 18:56:12 PDT 2005
harrison 05/06/29 18:56:12
Modified: . ChangeLog
khtml/editing insert_text_command.cpp markup.cpp
Log:
Temporarily enable tab coalescing ahead of white-space:pre-wrap
change because of problems with keeping the tabs separate. Will
revert when problems are fixed or remove if I do pre-wrap
first.
* khtml/editing/insert_text_command.cpp:
(khtml::InsertTextCommand::prepareForTextInsertion):
(khtml::InsertTextCommand::insertTab):
* khtml/editing/markup.cpp:
(khtml::createParagraphContentsFromString):
Revision Changes Path
1.4341 +13 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4340
retrieving revision 1.4341
diff -u -r1.4340 -r1.4341
--- ChangeLog 30 Jun 2005 01:27:35 -0000 1.4340
+++ ChangeLog 30 Jun 2005 01:56:08 -0000 1.4341
@@ -1,5 +1,18 @@
2005-06-29 David Harrison <harrison at apple.com>
+ Temporarily enable tab coalescing ahead of white-space:pre-wrap
+ change because of problems with keeping the tabs separate. Will
+ revert when problems are fixed or remove if I do pre-wrap
+ first.
+
+ * khtml/editing/insert_text_command.cpp:
+ (khtml::InsertTextCommand::prepareForTextInsertion):
+ (khtml::InsertTextCommand::insertTab):
+ * khtml/editing/markup.cpp:
+ (khtml::createParagraphContentsFromString):
+
+2005-06-29 David Harrison <harrison at apple.com>
+
Reviewed by Dave Hyatt (rendering) and Maciej (editing).
Test cases added: Coming soon. Will include with next round of changes for this bug.
1.3 +16 -9 WebCore/khtml/editing/insert_text_command.cpp
Index: insert_text_command.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/insert_text_command.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- insert_text_command.cpp 30 Jun 2005 01:27:38 -0000 1.2
+++ insert_text_command.cpp 30 Jun 2005 01:56:12 -0000 1.3
@@ -89,23 +89,28 @@
return Position(textNode, 0);
}
-#ifndef COALESCE_TAB_SPANS
- ASSERT(!isTabSpanTextNode(pos.node()));
-#else
if (isTabSpanTextNode(pos.node())) {
+ Position tempPos = pos;
+//#ifndef COALESCE_TAB_SPANS
+#if 0
+ NodeImpl *node = pos.node()->parentNode();
+ if (pos.offset() > pos.node()->caretMinOffset())
+ tempPos = Position(node->parentNode(), node->nodeIndex() + 1);
+ else
+ tempPos = Position(node->parentNode(), node->nodeIndex());
+#endif
NodeImpl *textNode = document()->createEditingTextNode("");
- NodeImpl *originalTabSpan = pos.node()->parent();
- if (pos.offset() <= pos.node()->caretMinOffset()) {
+ NodeImpl *originalTabSpan = tempPos.node()->parent();
+ if (tempPos.offset() <= tempPos.node()->caretMinOffset()) {
insertNodeBefore(textNode, originalTabSpan);
- } else if (pos.offset() >= pos.node()->caretMaxOffset()) {
+ } else if (tempPos.offset() >= tempPos.node()->caretMaxOffset()) {
insertNodeAfter(textNode, originalTabSpan);
} else {
- splitTextNodeContainingElement(static_cast<TextImpl *>(pos.node()), pos.offset());
+ splitTextNodeContainingElement(static_cast<TextImpl *>(tempPos.node()), tempPos.offset());
insertNodeBefore(textNode, originalTabSpan);
}
return Position(textNode, 0);
}
-#endif
return pos;
}
@@ -196,7 +201,8 @@
NodeImpl *node = insertPos.node();
unsigned int offset = insertPos.offset();
-#ifdef COALESCE_TAB_SPANS
+//#ifdef COALESCE_TAB_SPANS
+#if 1
// keep tabs coalesced in tab span
if (isTabSpanTextNode(node)) {
insertTextIntoNode(static_cast<TextImpl *>(node), offset, "\t");
@@ -204,6 +210,7 @@
}
#else
if (isTabSpanTextNode(node)) {
+ node = node->parentNode();
if (offset > (unsigned int) node->caretMinOffset())
insertPos = Position(node->parentNode(), node->nodeIndex() + 1);
else
1.22 +2 -1 WebCore/khtml/editing/markup.cpp
Index: markup.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/editing/markup.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- markup.cpp 30 Jun 2005 01:27:38 -0000 1.21
+++ markup.cpp 30 Jun 2005 01:56:12 -0000 1.22
@@ -518,7 +518,8 @@
// there is a tab after every entry, except the last entry
// (if the last character is a tab, the list gets an extra empty entry)
if (!tabList.isEmpty()) {
-#ifdef COALESCE_TAB_SPANS
+//#ifdef COALESCE_TAB_SPANS
+#if 1
tabText += '\t';
#else
paragraph->appendChild(createTabSpanElement(document), exceptionCode);
More information about the webkit-changes
mailing list