Title: [183635] trunk/Source/WebKit2
Revision
183635
Author
[email protected]
Date
2015-04-30 11:21:01 -0700 (Thu, 30 Apr 2015)

Log Message

[iOS] tapping in the middle of a word in editable content should not select the word.
https://bugs.webkit.org/show_bug.cgi?id=144421
rdar://problem/20710948

Reviewed by Tim Horton.

Reverting to the original behavior.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (183634 => 183635)


--- trunk/Source/WebKit2/ChangeLog	2015-04-30 18:20:47 UTC (rev 183634)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-30 18:21:01 UTC (rev 183635)
@@ -1,3 +1,16 @@
+2015-04-30  Enrica Casucci  <[email protected]>
+
+        [iOS] tapping in the middle of a word in editable content should not select the word.
+        https://bugs.webkit.org/show_bug.cgi?id=144421
+        rdar://problem/20710948
+
+        Reviewed by Tim Horton.
+
+        Reverting to the original behavior.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::selectWithGesture):
+
 2015-04-29  Hunseop Jeong  <[email protected]>
 
         Fix the EFL build after r183595

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (183634 => 183635)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-04-30 18:20:47 UTC (rev 183634)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-04-30 18:21:01 UTC (rev 183635)
@@ -964,11 +964,13 @@
             // Don't cross line boundaries.
             result = position;
         } else if (withinTextUnitOfGranularity(position, WordGranularity, DirectionForward)) {
-            // The position lies within a word, we want to select the word.
-            if (frame.selection().isCaret())
-                range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
-            else if (frame.selection().isRange() && (position < frame.selection().selection().start() || position > frame.selection().selection().end()))
-                result = position;
+            // The position lies within a word.
+            RefPtr<Range> wordRange = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
+            if (wordRange) {
+                result = wordRange->startPosition();
+                if (distanceBetweenPositions(position, result) > 1)
+                    result = wordRange->endPosition();
+            }
         } else if (atBoundaryOfGranularity(position, WordGranularity, DirectionBackward)) {
             // The position is at the end of a word.
             result = position;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to