Title: [224029] trunk/Source/WebKit
Revision
224029
Author
[email protected]
Date
2017-10-26 11:20:14 -0700 (Thu, 26 Oct 2017)

Log Message

Remove code to update block selection
https://bugs.webkit.org/show_bug.cgi?id=178843

Reviewed by Tim Horton.

Removes code for updating block selection, which has been disabled.
This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toSelectionHandlePosition): Deleted.
(-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
(-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
(WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::shouldExpand): Deleted.
(WebKit::WebPage::changeBlockSelection): Deleted.
(WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (224028 => 224029)


--- trunk/Source/WebKit/ChangeLog	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/ChangeLog	2017-10-26 18:20:14 UTC (rev 224029)
@@ -1,3 +1,35 @@
+2017-10-26  Megan Gardner  <[email protected]>
+
+        Remove code to update block selection
+        https://bugs.webkit.org/show_bug.cgi?id=178843
+
+        Reviewed by Tim Horton.
+
+        Removes code for updating block selection, which has been disabled.
+        This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (toSelectionHandlePosition): Deleted.
+        (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
+        (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
+        (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::shouldExpand): Deleted.
+        (WebKit::WebPage::changeBlockSelection): Deleted.
+        (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
+
 2017-10-26  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r223994.

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


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -618,7 +618,6 @@
 
 @optional
 
-- (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;
 - (void)clearSelection;
 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
 - (void)requestDictationContext:(void (^)(NSString *selectedText, NSString *prefixText, NSString *postfixText))completionHandler;

Modified: trunk/Source/WebKit/UIProcess/PageClient.h (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/PageClient.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -302,7 +302,6 @@
     virtual void positionInformationDidChange(const InteractionInformationAtPosition&) = 0;
     virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0;
     virtual bool allowsBlockSelection() = 0;
-    virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0;
     virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0;
     virtual double minimumZoomScale() const = 0;

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -515,7 +515,6 @@
     void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
     void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&&);
-    void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
     void extendSelection(WebCore::TextGranularity);
     void selectWordBackward();
     void moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&&);
@@ -540,7 +539,6 @@
     void stopInteraction();
     void performActionOnElement(uint32_t action);
     void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
-    void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
     void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&&);
     void setAssistedNodeValue(const String&);
     void setAssistedNodeValueAsNumber(double);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2017-10-26 18:20:14 UTC (rev 224029)
@@ -179,7 +179,6 @@
     InterpretKeyEvent(struct WebKit::EditorState state, bool isCharEvent) -> (bool handled)
     DidReceivePositionInformation(struct WebKit::InteractionInformationAtPosition information)
     SaveImageToLibrary(WebKit::SharedMemory::Handle handle, uint64_t size)
-    DidUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
     ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect)
     CommitPotentialTapFailed()
     DidNotHandleTapAsClick(WebCore::IntPoint point)

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -132,7 +132,6 @@
     void positionInformationDidChange(const InteractionInformationAtPosition&) override;
     void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) override;
     bool allowsBlockSelection() override;
-    void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;
     void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
 
     bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2017-10-26 18:20:14 UTC (rev 224029)
@@ -574,11 +574,6 @@
     return [m_webView _allowsBlockSelection];
 }
 
-void PageClientImpl::didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
-{
-    [m_contentView _didUpdateBlockSelectionWithTouch:(SelectionTouch)touch withFlags:(SelectionFlags)flags growThreshold:growThreshold shrinkThreshold:shrinkThreshold];
-}
-
 void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect)
 {
     [m_contentView _showPlaybackTargetPicker:hasVideo fromRect:elementRect];

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -294,7 +294,6 @@
 - (void)_didEndScrollingOrZooming;
 - (void)_overflowScrollingWillBegin;
 - (void)_overflowScrollingDidEnd;
-- (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect;
 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
 - (void)accessoryDone;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-10-26 18:20:14 UTC (rev 224029)
@@ -2478,20 +2478,6 @@
     return static_cast<UIWKSelectionFlags>(uiFlags);
 }
 
-static inline SelectionHandlePosition toSelectionHandlePosition(UIWKHandlePosition position)
-{
-    switch (position) {
-    case UIWKHandleTop:
-        return SelectionHandlePosition::Top;
-    case UIWKHandleRight:
-        return SelectionHandlePosition::Right;
-    case UIWKHandleBottom:
-        return SelectionHandlePosition::Bottom;
-    case UIWKHandleLeft:
-        return SelectionHandlePosition::Left;
-    }
-}
-
 static inline WebCore::TextGranularity toWKTextGranularity(UITextGranularity granularity)
 {
     switch (granularity) {
@@ -2550,13 +2536,6 @@
         [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
 }
 
-- (void)_didUpdateBlockSelectionWithTouch:(SelectionTouch)touch withFlags:(SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold
-{
-    [_webSelectionAssistant blockSelectionChangedWithTouch:toUIWKSelectionTouch(touch) withFlags:toUIWKSelectionFlags(flags) growThreshold:growThreshold shrinkThreshold:shrinkThreshold];
-    if (touch != SelectionTouch::Started && touch != SelectionTouch::Moved)
-        _usingGestureForSelection = NO;
-}
-
 - (BOOL)_isInteractingWithAssistedNode
 {
     return _textSelectionAssistant != nil;
@@ -2604,12 +2583,6 @@
     });
 }
 
-- (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle
-{
-    _usingGestureForSelection = YES;
-    _page->updateBlockSelectionWithTouch(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), static_cast<uint32_t>(toSelectionHandlePosition(handle)));
-}
-
 - (void)moveByOffset:(NSInteger)offset
 {
     if (!offset)

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (224028 => 224029)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-10-26 18:20:14 UTC (rev 224029)
@@ -616,11 +616,6 @@
     m_process->send(Messages::WebPage::SelectWithTwoTouches(from, to, gestureType, gestureState, callbackID), m_pageID);
 }
 
-void WebPageProxy::updateBlockSelectionWithTouch(const WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition)
-{
-    m_process->send(Messages::WebPage::UpdateBlockSelectionWithTouch(point, touch, handlePosition), m_pageID);
-}
-
 void WebPageProxy::didReceivePositionInformation(const InteractionInformationAtPosition& info)
 {
     m_pageClient.positionInformationDidChange(info);
@@ -653,11 +648,6 @@
     m_pageClient.saveImageToLibrary(WTFMove(buffer));
 }
 
-void WebPageProxy::didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
-{
-    m_pageClient.didUpdateBlockSelectionWithTouch(touch, flags, growThreshold, shrinkThreshold);
-}
-
 void WebPageProxy::applicationDidEnterBackground()
 {
     bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (224028 => 224029)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-10-26 18:20:14 UTC (rev 224029)
@@ -550,7 +550,6 @@
     void blurAssistedNode();
     void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID);
     void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
-    void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
     void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
     void extendSelection(uint32_t granularity);
     void selectWordBackward();
@@ -1026,7 +1025,6 @@
     RefPtr<WebCore::Range> rangeForWebSelectionAtPosition(const WebCore::IntPoint&, const WebCore::VisiblePosition&, SelectionFlags&);
     RefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
     void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
-    RefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
     Ref<WebCore::Range> expandedRangeFromHandle(WebCore::Range&, SelectionHandlePosition);
     Ref<WebCore::Range> contractedRangeFromHandle(WebCore::Range& currentRange, SelectionHandlePosition, SelectionFlags&);
     void getAssistedNodeInformation(AssistedNodeInformation&);

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (224028 => 224029)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-10-26 18:20:14 UTC (rev 224029)
@@ -57,7 +57,6 @@
     BlurAssistedNode()
     SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
     UpdateSelectionWithTouches(WebCore::IntPoint point, uint32_t touches, bool baseIsStart, WebKit::CallbackID callbackID)
-    UpdateBlockSelectionWithTouch(WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition)
     SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WebKit::CallbackID callbackID)
     ExtendSelection(uint32_t granularity)
     SelectWordBackward()

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


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-10-26 18:16:36 UTC (rev 224028)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-10-26 18:20:14 UTC (rev 224029)
@@ -1658,62 +1658,6 @@
 
 }
 
-static inline bool shouldExpand(SelectionHandlePosition handlePosition, const IntRect& rect, const IntPoint& point)
-{
-    switch (handlePosition) {
-    case SelectionHandlePosition::Top:
-        return (point.y() < rect.y());
-    case SelectionHandlePosition::Left:
-        return (point.x() < rect.x());
-    case SelectionHandlePosition::Right:
-        return (point.x() > rect.maxX());
-    case SelectionHandlePosition::Bottom:
-        return (point.y() > rect.maxY());
-    }
-}
-
-RefPtr<WebCore::Range> WebPage::changeBlockSelection(const IntPoint& point, SelectionHandlePosition handlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags& flags)
-{
-    Frame& frame = m_page->focusController().focusedOrMainFrame();
-    RefPtr<Range> currentRange = m_currentBlockSelection ? m_currentBlockSelection.get() : frame.selection().selection().toNormalizedRange();
-    if (!currentRange)
-        return nullptr;
-    RefPtr<Range> newRange = shouldExpand(handlePosition, selectionBoxForRange(currentRange.get()), point) ? expandedRangeFromHandle(*currentRange, handlePosition) : contractedRangeFromHandle(*currentRange, handlePosition, flags);
-
-    if (newRange) {
-        m_currentBlockSelection = newRange;
-        frame.selection().setSelectedRange(newRange.get(), VP_DEFAULT_AFFINITY, true, UserTriggered);
-    }
-
-    computeExpandAndShrinkThresholdsForHandle(point, handlePosition, growThreshold, shrinkThreshold);
-    return newRange;
-}
-
-void WebPage::updateBlockSelectionWithTouch(const IntPoint& point, uint32_t touch, uint32_t handlePosition)
-{
-    Frame& frame = m_page->focusController().focusedOrMainFrame();
-    IntPoint adjustedPoint = frame.view()->rootViewToContents(point);
-
-    float growThreshold = 0;
-    float shrinkThreshold = 0;
-    SelectionFlags flags = None;
-
-    switch (static_cast<SelectionTouch>(touch)) {
-    case SelectionTouch::Started:
-        computeExpandAndShrinkThresholdsForHandle(adjustedPoint, static_cast<SelectionHandlePosition>(handlePosition), growThreshold, shrinkThreshold);
-        break;
-    case SelectionTouch::Ended:
-        break;
-    case SelectionTouch::Moved:
-        changeBlockSelection(adjustedPoint, static_cast<SelectionHandlePosition>(handlePosition), growThreshold, shrinkThreshold, flags);
-        break;
-    default:
-        return;
-    }
-
-    send(Messages::WebPageProxy::DidUpdateBlockSelectionWithTouch(touch, static_cast<uint32_t>(flags), growThreshold, shrinkThreshold));
-}
-
 void WebPage::clearSelection()
 {
     m_currentBlockSelection = nullptr;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to