Title: [221443] trunk/Source/WebKit
Revision
221443
Author
megan_gard...@apple.com
Date
2017-08-31 14:13:38 -0700 (Thu, 31 Aug 2017)

Log Message

Remove IsBlockSelection flag
https://bugs.webkit.org/show_bug.cgi?id=176141

Reviewed by Dean Jackson.

Block selection is disabled. Removed code associated with this flag to allow removal of the
flag in UIKit.
        
No tests for a removed feature.

* Platform/spi/ios/UIKitSPI.h:
* Shared/ios/GestureTypes.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toUIWKSelectionFlags):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::contractedRangeFromHandle):
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
(WebKit::WebPage::updateBlockSelectionWithTouch):
(WebKit::WebPage::updateSelectionWithTouches):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (221442 => 221443)


--- trunk/Source/WebKit/ChangeLog	2017-08-31 20:57:45 UTC (rev 221442)
+++ trunk/Source/WebKit/ChangeLog	2017-08-31 21:13:38 UTC (rev 221443)
@@ -1,3 +1,27 @@
+2017-08-30  Megan Gardner  <megan_gard...@apple.com>
+
+        Remove IsBlockSelection flag
+        https://bugs.webkit.org/show_bug.cgi?id=176141
+
+        Reviewed by Dean Jackson.
+
+        Block selection is disabled. Removed code associated with this flag to allow removal of the
+        flag in UIKit.
+        
+        No tests for a removed feature.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * Shared/ios/GestureTypes.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (toUIWKSelectionFlags):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::rangeForWebSelectionAtPosition):
+        (WebKit::WebPage::selectWithGesture):
+        (WebKit::WebPage::contractedRangeFromHandle):
+        (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
+        (WebKit::WebPage::updateBlockSelectionWithTouch):
+        (WebKit::WebPage::updateSelectionWithTouches):
+
 2017-08-30  Alex Christensen  <achristen...@webkit.org>
 
         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (221442 => 221443)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-08-31 20:57:45 UTC (rev 221442)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-08-31 21:13:38 UTC (rev 221443)
@@ -507,7 +507,6 @@
 typedef NS_ENUM(NSInteger, UIWKSelectionFlags) {
     UIWKNone = 0,
     UIWKWordIsNearTap = 1,
-    UIWKIsBlockSelection = 2,
     UIWKPhraseBoundaryChanged = 4,
 };
 

Modified: trunk/Source/WebKit/Shared/ios/GestureTypes.h (221442 => 221443)


--- trunk/Source/WebKit/Shared/ios/GestureTypes.h	2017-08-31 20:57:45 UTC (rev 221442)
+++ trunk/Source/WebKit/Shared/ios/GestureTypes.h	2017-08-31 21:13:38 UTC (rev 221443)
@@ -73,8 +73,7 @@
 enum SelectionFlags {
     None = 0,
     WordIsNearTap = 1 << 0,
-    IsBlockSelection = 1 << 1,
-    PhraseBoundaryChanged = 1 << 2,
+    PhraseBoundaryChanged = 1 << 1,
 };
 
 enum class SelectionHandlePosition {

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (221442 => 221443)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-08-31 20:57:45 UTC (rev 221442)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-08-31 21:13:38 UTC (rev 221443)
@@ -2462,8 +2462,6 @@
     NSInteger uiFlags = UIWKNone;
     if (flags & WordIsNearTap)
         uiFlags |= UIWKWordIsNearTap;
-    if (flags & IsBlockSelection)
-        uiFlags |= UIWKIsBlockSelection;
     if (flags & PhraseBoundaryChanged)
         uiFlags |= UIWKPhraseBoundaryChanged;
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (221442 => 221443)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-08-31 20:57:45 UTC (rev 221442)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-08-31 21:13:38 UTC (rev 221443)
@@ -1016,7 +1016,6 @@
     if (boundingRectInScrollViewCoordinates.height() > m_page->mainFrame().view()->exposedContentRect().height() * adjustmentFactor)
         return nullptr;
 
-    flags = IsBlockSelection;
     range = Range::create(bestChoice->document());
     range->selectNodeContents(*bestChoice);
     return range->collapsed() ? nullptr : range;
@@ -1172,8 +1171,6 @@
             m_currentBlockSelection = nullptr;
         }
         range = rangeForWebSelectionAtPosition(point, position, flags);
-        if (wkGestureState == GestureRecognizerState::Ended && flags & IsBlockSelection)
-            m_currentBlockSelection = range;
         break;
 
     default:
@@ -1429,7 +1426,6 @@
 
     IntRect currentBox = selectionBoxForRange(&currentRange);
     IntPoint edgeCenter = computeEdgeCenter(currentBox, handlePosition);
-    flags = IsBlockSelection;
 
     float maxDistance;
 
@@ -1613,8 +1609,6 @@
     if (areRangesEqual(expandedRange.ptr(), currentRange.get()))
         growThreshold = maxThreshold;
 
-    if (flags & IsBlockSelection && areRangesEqual(contractedRange.get(), currentRange.get()))
-        shrinkThreshold = minThreshold;
 }
 
 static inline bool shouldExpand(SelectionHandlePosition handlePosition, const IntRect& rect, const IntPoint& point)
@@ -1655,7 +1649,7 @@
 
     float growThreshold = 0;
     float shrinkThreshold = 0;
-    SelectionFlags flags = IsBlockSelection;
+    SelectionFlags flags = None;
 
     switch (static_cast<SelectionTouch>(touch)) {
     case SelectionTouch::Started:
@@ -1762,25 +1756,14 @@
     case SelectionTouch::Moved:
         if (shouldSwitchToBlockModeForHandle(pointInDocument, handlePosition)) {
             range = switchToBlockSelectionAtPoint(pointInDocument, handlePosition);
-            flags = IsBlockSelection;
         } else
             range = rangeForPosition(&frame, position, baseIsStart);
         break;
     }
-    if (range && flags != IsBlockSelection)
+    if (range)
         frame.selection().setSelectedRange(range.get(), position.affinity(), true, UserTriggered);
 
     send(Messages::WebPageProxy::TouchesCallback(point, touches, flags, callbackID));
-    if (range && flags == IsBlockSelection) {
-        // We just switched to block selection therefore we need to compute the thresholds.
-        m_currentBlockSelection = range;
-        frame.selection().setSelectedRange(range.get(), position.affinity(), true, UserTriggered);
-        
-        float growThreshold = 0;
-        float shrinkThreshold = 0;
-        computeExpandAndShrinkThresholdsForHandle(point, handlePosition, growThreshold, shrinkThreshold);
-        send(Messages::WebPageProxy::DidUpdateBlockSelectionWithTouch(static_cast<uint32_t>(SelectionTouch::Started), static_cast<uint32_t>(IsBlockSelection), growThreshold, shrinkThreshold));
-    }
 }
 
 void WebPage::selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID callbackID)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to