Title: [172774] branches/safari-600.1-branch/Source/WebKit2
Revision
172774
Author
dburk...@apple.com
Date
2014-08-19 16:09:56 -0700 (Tue, 19 Aug 2014)

Log Message

Merge r172643. <rdar://problem/18032571>

Modified Paths

Diff

Modified: branches/safari-600.1-branch/Source/WebKit2/ChangeLog (172773 => 172774)


--- branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-08-19 23:06:37 UTC (rev 172773)
+++ branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-08-19 23:09:56 UTC (rev 172774)
@@ -1,5 +1,23 @@
 2014-08-19  Dana Burkart  <dburk...@apple.com>
 
+        Merge r172643. <rdar://problem/18032571>
+
+    2014-08-15  Enrica Casucci  <enr...@apple.com>
+    
+            [Services with UI] Selections are incorrect when selecting three lines.
+            https://bugs.webkit.org/show_bug.cgi?id=135989
+            <rdar://problem/18032571>
+    
+            Reviewed by Tim Horton.
+    
+            The stitching algorithm did not handle correctly the case of selections
+            over three lines if the middle line is composed of only one rectangle.
+    
+            * WebProcess/WebPage/mac/ServicesOverlayController.mm:
+            (WebKit::stitchRects):
+    
+2014-08-19  Dana Burkart  <dburk...@apple.com>
+
         Merge r172639. <rdar://problem/17957716>
 
     2014-08-15  Tim Horton  <timothy_hor...@apple.com>

Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm (172773 => 172774)


--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm	2014-08-19 23:06:37 UTC (rev 172773)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm	2014-08-19 23:09:56 UTC (rev 172774)
@@ -279,7 +279,7 @@
     // First stitch together all the rects on the first line of the selection.
     size_t indexFromStart = 0;
     LayoutUnit firstTop = rects[indexFromStart].y();
-    LayoutRect& currentRect = rects[indexFromStart++];
+    LayoutRect& currentRect = rects[indexFromStart];
     while (indexFromStart < rects.size() && rects[indexFromStart].y() == firstTop)
         currentRect.unite(rects[indexFromStart++]);
     
@@ -294,18 +294,22 @@
     size_t indexFromEnd = rects.size() - 1;
     LayoutUnit lastTop = rects[indexFromEnd].y();
     LayoutRect lastRect = rects[indexFromEnd];
-    while (indexFromEnd != indexFromStart && rects[--indexFromEnd].y() == lastTop)
-        lastRect.unite(rects[indexFromEnd]);
+    while (indexFromEnd >= indexFromStart && rects[indexFromEnd].y() == lastTop)
+        lastRect.unite(rects[indexFromEnd--]);
     
-    if (indexFromEnd == indexFromStart) {
-        // All the rects are on two lines only. There is nothing else to do.
+    // indexFromStart is the index of the first rectangle on the second line.
+    // indexFromEnd is the index of the last rectangle on the second to the last line.
+    // if they are equal, there is one additional rectangle for the line in the middle.
+    if (indexFromEnd == indexFromStart)
+        newRects.append(rects[indexFromStart]);
+    
+    if (indexFromEnd <= indexFromStart) {
+        // There are no more rects to stitch. Just append the last line.
         newRects.append(lastRect);
         rects.swap(newRects);
         return;
     }
     
-    // indexFromStart is the index of the first rectangle on the second line.
-    // indexFromEnd is the index of the last rectangle on the second to the last line.
     // Stitch together all the rects after the first line until the second to the last included.
     currentRect = rects[indexFromStart];
     while (indexFromStart != indexFromEnd)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to