Backed out my patch since the tree was closed.
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2005 01:00:02 +0000 (01:00 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2005 01:00:02 +0000 (01:00 +0000)
        * khtml/editing/htmlediting.cpp:
        (khtml::DeleteSelectionCommand::initializePositionData):
        * khtml/editing/jsediting.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8736 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/jsediting.cpp

index 458d65f1c198b7fa322428525ceafdea60ba4cfd..57e257df290e2bd85499dcdd8c5ba6ca88d91017 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-01  Chris Blumenberg  <cblu@apple.com>
+
+       Backed out my patch since the tree was closed.
+
+        * khtml/editing/htmlediting.cpp:
+        (khtml::DeleteSelectionCommand::initializePositionData):
+        * khtml/editing/jsediting.cpp:
+
 2005-03-01  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/3990258> REGRESSION (125.12-181): top of picture that spans two pages is cut off on print from Safari
index e3f2a19dc3fff65286597c35bced949bd4d17589..726a241acefe987c786c59f6fbb1ad6226302a1f 100644 (file)
@@ -2343,31 +2343,27 @@ void DeleteSelectionCommand::initializePositionData()
     // Handle leading and trailing whitespace, as well as smart delete adjustments to the selection
     //
     m_leadingWhitespace = m_upstreamStart.leadingWhitespacePosition(m_selectionToDelete.startAffinity());
+    bool hasLeadingWhitespaceBeforeAdjustment = m_leadingWhitespace.isNotNull();
+    if (m_smartDelete && hasLeadingWhitespaceBeforeAdjustment) {
+        VisiblePosition visiblePos = VisiblePosition(start, m_selectionToDelete.startAffinity()).previous();
+        Position pos = visiblePos.deepEquivalent();
+        // Expand out one character upstream for smart delete and recalculate
+        // positions based on this change.
+        m_upstreamStart = pos.upstream(StayInBlock);
+        m_downstreamStart = pos.downstream(StayInBlock);
+        m_leadingWhitespace = m_upstreamStart.leadingWhitespacePosition(visiblePos.affinity());
+    }
     m_trailingWhitespace = m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY);
-
-    if (m_smartDelete) {
-        bool hasLeadingWhitespaceBeforeAdjustment = m_upstreamStart.leadingWhitespacePosition(m_selectionToDelete.startAffinity(), true).isNotNull();
-        if (hasLeadingWhitespaceBeforeAdjustment) {
-            VisiblePosition visiblePos = VisiblePosition(start, m_selectionToDelete.startAffinity()).previous();
-            Position pos = visiblePos.deepEquivalent();
-            // Expand out one character upstream for smart delete and recalculate
-            // positions based on this change.
-            m_upstreamStart = pos.upstream(StayInBlock);
-            m_downstreamStart = pos.downstream(StayInBlock);
-            m_leadingWhitespace = m_upstreamStart.leadingWhitespacePosition(visiblePos.affinity());
-        }
-        // Note: trailing whitespace is only considered for smart delete if there is no leading
-        // whitespace, as in the case where you double-click the first word of a paragraph.
-        if (!hasLeadingWhitespaceBeforeAdjustment && m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNotNull()) {
-            // Expand out one character downstream for smart delete and recalculate
-            // positions based on this change.
-            Position pos = VisiblePosition(end, m_selectionToDelete.endAffinity()).next().deepEquivalent();
-            m_upstreamEnd = pos.upstream(StayInBlock);
-            m_downstreamEnd = pos.downstream(StayInBlock);
-            m_trailingWhitespace = m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY);
-        }
+    // Note: trailing whitespace is only considered for smart delete if there is no leading
+    // whitespace, as in the case where you double-click the first word of a paragraph.
+    if (m_smartDelete && !hasLeadingWhitespaceBeforeAdjustment && m_trailingWhitespace.isNotNull()) {
+        // Expand out one character downstream for smart delete and recalculate
+        // positions based on this change.
+        Position pos = VisiblePosition(end, m_selectionToDelete.endAffinity()).next().deepEquivalent();
+        m_upstreamEnd = pos.upstream(StayInBlock);
+        m_downstreamEnd = pos.downstream(StayInBlock);
+        m_trailingWhitespace = m_downstreamEnd.trailingWhitespacePosition(VP_DEFAULT_AFFINITY);
     }
-    
     m_trailingWhitespaceValid = true;
     
     //
index c153c36f5a30fd572ec4fe9b42cc16997a25c96e..f9c847f047553dcdeedf6f87316ffa4f89a102a4 100644 (file)
@@ -210,7 +210,7 @@ bool execCut(KHTMLPart *part, bool userInterface, const DOMString &value)
 
 bool execDelete(KHTMLPart *part, bool userInterface, const DOMString &value)
 {
-    TypingCommand::deleteKeyPressed(part->xmlDocImpl(), part->selectionGranularity() == khtml::WORD);
+    TypingCommand::deleteKeyPressed(part->xmlDocImpl());
     return true;
 }