[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:22:23 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 342ddf168eefa56f22dde85b7c8dd70ba02a1f55
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 15 09:10:00 2010 +0000

    2010-03-15  MORITA Hajime  <morrita at google.com>
    
            Reviewed by Alexey Proskuryakov.
    
            Selection.modify extends too far with 'lineboundary'.
            https://bugs.webkit.org/show_bug.cgi?id=33413
    
            * editing/selection/extend-selection-expected.txt:
            * platform/win/editing/selection/extend-selection-expected.txt:
            Updated result to correct expectation that described the wrong
            behaviour for the selection expansion with 'lineboundary'
            granularity.
    2010-03-15  MORITA Hajime  <morrita at google.com>
    
            Reviewed by Alexey Proskuryakov.
    
            Selection.modify extends too far with 'lineboundary'.
            https://bugs.webkit.org/show_bug.cgi?id=33413
    
            Selection.modify() with 'lineboundary' granularity implies just
            "Go to the end of the line", unlike selection expansion with
            other type of granularities. This change handled LineGranularity
            as special case, to look-up end of line with UPSTREAM affinity.
            Doing this prevents look-up algorithm to go next line.
    
            Test: editing/selection/extend-selection-expected.txt
    
            * dom/Position.cpp:
            (WebCore::Position::getInlineBoxAndOffset):
            Handled an edge case for node look-up with UPSTREAM.
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::modifyExtendingForward):
            Added UPSTREAM tweak for the case for LineGranularity.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55990 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 59d08b6..e31a0c3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-15  MORITA Hajime  <morrita at google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Selection.modify extends too far with 'lineboundary'.
+        https://bugs.webkit.org/show_bug.cgi?id=33413
+
+        * editing/selection/extend-selection-expected.txt:
+        * platform/win/editing/selection/extend-selection-expected.txt: 
+        Updated result to correct expectation that described the wrong
+        behaviour for the selection expansion with 'lineboundary'
+        granularity.
+        
 2010-03-14  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Shinichiro Hamaji.
diff --git a/LayoutTests/editing/selection/extend-selection-expected.txt b/LayoutTests/editing/selection/extend-selection-expected.txt
index 1617e03..0b33cd2 100644
--- a/LayoutTests/editing/selection/extend-selection-expected.txt
+++ b/LayoutTests/editing/selection/extend-selection-expected.txt
@@ -514,14 +514,14 @@ Test 20, RTL:
   Extending forward: "ABC abc DEF"[(0,0), (0,11)]
   Extending backward:  "ABC abc DEF"[(0,11), (0,0)]
 Test 21, LTR:
-  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8), (0,16), (0,26), (0,34), (0,42), (0,50), (0,58), (0,66), (0,74), (0,82), (0,90), (0,98), (0,105)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,105), (0,0)]
+  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 21, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,7)]
   Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,7), (0,0)]
 Test 22, LTR:
-  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8), (0,16), (0,26), (0,34), (0,42), (0,50), (0,58), (0,66), (0,74), (0,82), (0,90), (0,98), (0,105)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,105), (0,0)]
+  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8), (0,0)]
 Test 22, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,7)]
   Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,7), (0,0)]
diff --git a/LayoutTests/platform/win/editing/selection/extend-selection-expected.txt b/LayoutTests/platform/win/editing/selection/extend-selection-expected.txt
index 5e57843..e5f3bc1 100644
--- a/LayoutTests/platform/win/editing/selection/extend-selection-expected.txt
+++ b/LayoutTests/platform/win/editing/selection/extend-selection-expected.txt
@@ -514,14 +514,14 @@ Test 20, RTL:
   Extending forward: "ABC abc DEF"[(0,0), (0,11)]
   Extending backward:  "ABC abc DEF"[(0,11), (0,0)]
 Test 21, LTR:
-  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8), (0,16), (0,26), (0,34), (0,42), (0,50), (0,58), (0,66), (0,74), (0,82), (0,90), (0,98), (0,105)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,105), (0,98)]
+  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
 Test 21, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,7)]
   Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,7), (0,0)]
 Test 22, LTR:
-  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8), (0,16), (0,26), (0,34), (0,42), (0,50), (0,58), (0,66), (0,74), (0,82), (0,90), (0,98), (0,105)]
-  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,105), (0,98)]
+  Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,8)]
+  Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,8)]
 Test 22, RTL:
   Extending forward: "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,0), (0,7)]
   Extending backward:  "abcdefg abcdefg abcdefg a abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg "[(0,7), (0,0)]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5bba101..b32127b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-03-15  MORITA Hajime  <morrita at google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Selection.modify extends too far with 'lineboundary'.
+        https://bugs.webkit.org/show_bug.cgi?id=33413
+
+        Selection.modify() with 'lineboundary' granularity implies just
+        "Go to the end of the line", unlike selection expansion with
+        other type of granularities. This change handled LineGranularity
+        as special case, to look-up end of line with UPSTREAM affinity. 
+        Doing this prevents look-up algorithm to go next line.
+
+        Test: editing/selection/extend-selection-expected.txt
+
+        * dom/Position.cpp:
+        (WebCore::Position::getInlineBoxAndOffset):
+        Handled an edge case for node look-up with UPSTREAM.
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::modifyExtendingForward):
+        Added UPSTREAM tweak for the case for LineGranularity.
+        
 2010-03-14  Yuzo Fujishima  <yuzo at google.com>
 
         Reviewed by Shinichiro Hamaji.
diff --git a/WebCore/dom/Position.cpp b/WebCore/dom/Position.cpp
index ef0b3c1..b471a99 100644
--- a/WebCore/dom/Position.cpp
+++ b/WebCore/dom/Position.cpp
@@ -1041,7 +1041,8 @@ void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDi
                 return;
             }
 
-            if ((caretOffset == caretMinOffset) ^ (affinity == UPSTREAM))
+            if (((caretOffset == caretMaxOffset) ^ (affinity == DOWNSTREAM))
+                || ((caretOffset == caretMinOffset) ^ (affinity == UPSTREAM)))
                 break;
 
             candidate = box;
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index c0f03de..38a6e7b 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -351,7 +351,9 @@ VisiblePosition SelectionController::modifyExtendingForward(TextGranularity gran
             pos = endOfSentence(endForPlatform());
             break;
         case LineBoundary:
-            pos = logicalEndOfLine(endForPlatform());
+            pos = endForPlatform();
+            pos.setAffinity(UPSTREAM);
+            pos = logicalEndOfLine(pos);
             break;
         case ParagraphBoundary:
             pos = endOfParagraph(endForPlatform());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list