[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 13:35:36 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e13ae3c03efceab81081697588635c83f92a4aa5
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 01:51:21 2010 +0000

    2010-09-19  Antonio Gomes  <agomes at rim.com>
    
            Reviewed by Ojan Vafai.
    
            SelectionController::modify should ask EditingBehavior for platform specific behavior
            https://bugs.webkit.org/show_bug.cgi?id=41975
    
            As a follow up of the refactoring work in bug 39854, patch makes SelectionController::modify()
            stop accessing EditingBehaviorType values directly, and replaces its use by the EditingBehavior class.
    
            Since the "Settings*" parameter of the private SelectionController::modify() method becomes unneeded
            with this change (it was used to query the editingBehaviorType), patch merges two modify() methods.
    
            No behavior change, so no new tests.
    
            * editing/EditingBehavior.h:
            (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::modify):
            * editing/SelectionController.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1f755a4..2d744fc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-19  Antonio Gomes  <agomes at rim.com>
+
+        Reviewed by Ojan Vafai.
+
+        SelectionController::modify should ask EditingBehavior for platform specific behavior
+        https://bugs.webkit.org/show_bug.cgi?id=41975
+
+        As a follow up of the refactoring work in bug 39854, patch makes SelectionController::modify()
+        stop accessing EditingBehaviorType values directly, and replaces its use by the EditingBehavior
+        class.
+
+        Since the "Settings*" parameter of the private SelectionController::modify() method becomes unneeded
+        with this change (it was used to query the editingBehaviorType), patch merges two modify() methods.
+
+        No behavior change, so no new tests.
+
+        * editing/EditingBehavior.h:
+        (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::modify):
+        * editing/SelectionController.h:
+
 2010-09-20  Vangelis Kokkevis  <vangelis at chromium.org>
 
         Reviewed by James Robinson.
diff --git a/WebCore/editing/EditingBehavior.h b/WebCore/editing/EditingBehavior.h
index d442ad6..842d3f2 100644
--- a/WebCore/editing/EditingBehavior.h
+++ b/WebCore/editing/EditingBehavior.h
@@ -53,6 +53,10 @@ public:
     // style has to be present throughout the selection.
     bool shouldToggleStyleBasedOnStartOfSelection() const { return m_type == EditingMacBehavior; }
 
+    // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the base
+    // in place and moving the extent. Matches NSTextView.
+    bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingMacBehavior; }
+
 private:
     EditingBehaviorType m_type;
 };
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index c04fe25..c9295d3 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -622,24 +622,18 @@ VisiblePosition SelectionController::modifyMovingBackward(TextGranularity granul
     return pos;
 }
 
-bool SelectionController::modify(EAlteration alter, EDirection dir, TextGranularity granularity, bool userTriggered)
-{
-    Settings* settings = m_frame ? m_frame->settings() : 0;
-    return modify(alter, dir, granularity, userTriggered, settings);
-}
-    
 static bool isBoundary(TextGranularity granularity)
 {
     return granularity == LineBoundary || granularity == ParagraphBoundary || granularity == DocumentBoundary;
 }    
     
-bool SelectionController::modify(EAlteration alter, EDirection direction, TextGranularity granularity, bool userTriggered, Settings* settings)
+bool SelectionController::modify(EAlteration alter, EDirection direction, TextGranularity granularity, bool userTriggered)
 {
     if (userTriggered) {
         SelectionController trialSelectionController;
         trialSelectionController.setSelection(m_selection);
         trialSelectionController.setIsDirectional(m_isDirectional);
-        trialSelectionController.modify(alter, direction, granularity, false, settings);
+        trialSelectionController.modify(alter, direction, granularity, false);
 
         bool change = shouldChangeSelection(trialSelectionController.selection());
         if (!change)
@@ -690,16 +684,17 @@ bool SelectionController::modify(EAlteration alter, EDirection direction, TextGr
         moveTo(position, userTriggered);
         break;
     case AlterationExtend:
-        if (!settings || settings->editingBehaviorType() != EditingMacBehavior || m_selection.isCaret() || !isBoundary(granularity))
+        // Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the
+        // base in place and moving the extent. Matches NSTextView.
+        if (!m_frame || !m_frame->editor()->behavior().shouldAlwaysGrowSelectionWhenExtendingToBoundary() || m_selection.isCaret() || !isBoundary(granularity))
             setExtent(position, userTriggered);
         else {
-            // Standard Mac behavior when extending to a boundary is grow the selection rather
-            // than leaving the base in place and moving the extent. Matches NSTextView.
             if (direction == DirectionForward || direction == DirectionRight)
                 setEnd(position, userTriggered);
             else
                 setStart(position, userTriggered);
         }
+        break;
     }
     
     if (granularity == LineGranularity || granularity == ParagraphGranularity)
diff --git a/WebCore/editing/SelectionController.h b/WebCore/editing/SelectionController.h
index 90018cd..34d6ed9 100644
--- a/WebCore/editing/SelectionController.h
+++ b/WebCore/editing/SelectionController.h
@@ -181,8 +181,6 @@ private:
     VisiblePosition startForPlatform() const;
     VisiblePosition endForPlatform() const;
 
-    bool modify(EAlteration, EDirection, TextGranularity, bool userTriggered, Settings*);
-
     VisiblePosition modifyExtendingRight(TextGranularity);
     VisiblePosition modifyExtendingForward(TextGranularity);
     VisiblePosition modifyMovingRight(TextGranularity);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list