Reviewed by Maciej.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2005 20:42:40 +0000 (20:42 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Jan 2005 20:42:40 +0000 (20:42 +0000)
        <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space

        * khtml/editing/selection.cpp:
        (khtml::Selection::validate):
        Tune word selections left/right choice to use right if on empty last line.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/SelectionController.cpp
WebCore/khtml/editing/selection.cpp

index b248670ca3d00a1e37e93e61298e20aa45ba5fdd..00280d44dd0bf40edf4f559c3605e3e85b86cca1 100644 (file)
@@ -1,3 +1,13 @@
+2005-01-08  David Harrison  <harrison@apple.com>
+
+        Reviewed by Maciej.
+
+        <rdar://problem/3943415> REGRESSION (Mail): double-clicking past word selects previous word instead of only blank space
+        
+        * khtml/editing/selection.cpp:
+        (khtml::Selection::validate):
+        Tune word selections left/right choice to use right if on empty last line.
+
 2005-01-07  David Harrison  <harrison@apple.com>
 
         Reviewed by Darin.
index c62cf46ac35a73adf998a6f3db1d35c96653b9c3..2afe0164e2a508a1f8f878f61f5bf486a6004293 100644 (file)
@@ -878,7 +878,7 @@ void Selection::validate(ETextGranularity granularity)
                 m_end = wordEnd.deepEquivalent();
                 
                 // when double-clicking at end of document, select the last word
-                EWordSide side = (isCaret() && wordEnd.next().isNull()) ? LeftWordIfOnBoundary : RightWordIfOnBoundary;
+                EWordSide side = (isCaret() && wordEnd.next().isNull() && !isFirstVisiblePositionOnLine(wordEnd)) ? LeftWordIfOnBoundary : RightWordIfOnBoundary;
                 
                 m_start = startOfWord(VisiblePosition(m_base), side).deepEquivalent();
             } else {
index c62cf46ac35a73adf998a6f3db1d35c96653b9c3..2afe0164e2a508a1f8f878f61f5bf486a6004293 100644 (file)
@@ -878,7 +878,7 @@ void Selection::validate(ETextGranularity granularity)
                 m_end = wordEnd.deepEquivalent();
                 
                 // when double-clicking at end of document, select the last word
-                EWordSide side = (isCaret() && wordEnd.next().isNull()) ? LeftWordIfOnBoundary : RightWordIfOnBoundary;
+                EWordSide side = (isCaret() && wordEnd.next().isNull() && !isFirstVisiblePositionOnLine(wordEnd)) ? LeftWordIfOnBoundary : RightWordIfOnBoundary;
                 
                 m_start = startOfWord(VisiblePosition(m_base), side).deepEquivalent();
             } else {