[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:41:42 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 4b7e251b952dfd5ccbfcab5b29b6b6a66ab416a1
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue May 25 20:29:56 2004 +0000

            Reviewed by Chris
    
            Defer setting the selection to delete when none has been passed in to the
            time that the command is run. This fixes a problem where a command nested
            in a composite was not correctly picking up the right selection to begin
            its work. Now, the command will correctly use the ending selection of
            its parent when no selection has been passed in.
    
            * khtml/editing/htmlediting_impl.cpp:
            (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
            (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
            (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
            (khtml::DeleteSelectionCommandImpl::doApply):
            * khtml/editing/htmlediting_impl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6682 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1b2a517..4935d6c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2004-05-25  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Chris
+        
+        Defer setting the selection to delete when none has been passed in to the
+        time that the command is run. This fixes a problem where a command nested
+        in a composite was not correctly picking up the right selection to begin
+        its work. Now, the command will correctly use the ending selection of
+        its parent when no selection has been passed in.
+
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl):
+        (khtml::DeleteCollapsibleWhitespaceCommandImpl::doApply):
+        (khtml::DeleteSelectionCommandImpl::DeleteSelectionCommandImpl):
+        (khtml::DeleteSelectionCommandImpl::doApply):
+        * khtml/editing/htmlediting_impl.h:
+
 2004-05-24  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 2d128ff..5683ba8 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -1047,12 +1047,12 @@ void ApplyStyleCommandImpl::applyUsingFragment()
 // DeleteCollapsibleWhitespaceCommandImpl
 
 DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl(DocumentImpl *document)
-    : CompositeEditCommandImpl(document), m_selectionToCollapse(endingSelection()), m_charactersDeleted(0)
+    : CompositeEditCommandImpl(document), m_charactersDeleted(0), m_hasSelectionToCollapse(false)
 {
 }
 
 DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl(DocumentImpl *document, const Selection &selection)
-    : CompositeEditCommandImpl(document), m_selectionToCollapse(selection), m_charactersDeleted(0)
+    : CompositeEditCommandImpl(document), m_charactersDeleted(0), m_selectionToCollapse(selection), m_hasSelectionToCollapse(true)
 {
 }
 
@@ -1178,6 +1178,10 @@ Position DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace(const Position
 
 void DeleteCollapsibleWhitespaceCommandImpl::doApply()
 {
+    // If selection has not been set to a custom selection when the command was created,
+    // use the current ending selection.
+    if (!m_hasSelectionToCollapse)
+        m_selectionToCollapse = endingSelection();
     int state = m_selectionToCollapse.state();
     if (state == Selection::CARET) {
         Position endPosition = deleteWhitespace(m_selectionToCollapse.start());
@@ -1202,15 +1206,13 @@ void DeleteCollapsibleWhitespaceCommandImpl::doApply()
 // DeleteSelectionCommandImpl
 
 DeleteSelectionCommandImpl::DeleteSelectionCommandImpl(DocumentImpl *document)
-    : CompositeEditCommandImpl(document)
+    : CompositeEditCommandImpl(document), m_hasSelectionToDelete(false)
 {
-    m_selectionToDelete = endingSelection();
 }
 
 DeleteSelectionCommandImpl::DeleteSelectionCommandImpl(DocumentImpl *document, const Selection &selection)
-    : CompositeEditCommandImpl(document)
+    : CompositeEditCommandImpl(document), m_selectionToDelete(selection), m_hasSelectionToDelete(true)
 {
-    m_selectionToDelete = selection;
 }
 
 DeleteSelectionCommandImpl::~DeleteSelectionCommandImpl()
@@ -1289,6 +1291,11 @@ bool DeleteSelectionCommandImpl::containsOnlyWhitespace(const Position &start, c
 
 void DeleteSelectionCommandImpl::doApply()
 {
+    // If selection has not been set to a custom selection when the command was created,
+    // use the current ending selection.
+    if (!m_hasSelectionToDelete)
+        m_selectionToDelete = endingSelection();
+        
     if (m_selectionToDelete.state() != Selection::RANGE)
         return;
 
diff --git a/WebCore/khtml/editing/htmlediting_impl.h b/WebCore/khtml/editing/htmlediting_impl.h
index f33ae3c..b737416 100644
--- a/WebCore/khtml/editing/htmlediting_impl.h
+++ b/WebCore/khtml/editing/htmlediting_impl.h
@@ -237,8 +237,9 @@ public:
 private:
     DOM::Position deleteWhitespace(const DOM::Position &pos);
 
-    DOM::Selection m_selectionToCollapse;
     unsigned long m_charactersDeleted;
+    DOM::Selection m_selectionToCollapse;
+    bool m_hasSelectionToCollapse;
 };
 
 //------------------------------------------------------------------------------------------
@@ -262,6 +263,7 @@ private:
     void joinTextNodesWithSameStyle();
 
     DOM::Selection m_selectionToDelete;
+    bool m_hasSelectionToDelete;
 };
 
 //------------------------------------------------------------------------------------------

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list