Changeset 224029 in webkit


Ignore:
Timestamp:
Oct 26, 2017 11:20:14 AM (7 years ago)
Author:
Megan Gardner
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.

Location:
trunk/Source/WebKit
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r224024 r224029  
     12017-10-26  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Remove code to update block selection
     4        https://bugs.webkit.org/show_bug.cgi?id=178843
     5
     6        Reviewed by Tim Horton.
     7
     8        Removes code for updating block selection, which has been disabled.
     9        This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.
     10
     11        * Platform/spi/ios/UIKitSPI.h:
     12        * UIProcess/PageClient.h:
     13        * UIProcess/WebPageProxy.h:
     14        * UIProcess/WebPageProxy.messages.in:
     15        * UIProcess/ios/PageClientImplIOS.h:
     16        * UIProcess/ios/PageClientImplIOS.mm:
     17        (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
     18        * UIProcess/ios/WKContentViewInteraction.h:
     19        * UIProcess/ios/WKContentViewInteraction.mm:
     20        (toSelectionHandlePosition): Deleted.
     21        (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
     22        (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
     23        * UIProcess/ios/WebPageProxyIOS.mm:
     24        (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
     25        (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
     26        * WebProcess/WebPage/WebPage.h:
     27        * WebProcess/WebPage/WebPage.messages.in:
     28        * WebProcess/WebPage/ios/WebPageIOS.mm:
     29        (WebKit::shouldExpand): Deleted.
     30        (WebKit::WebPage::changeBlockSelection): Deleted.
     31        (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
     32
    1332017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
    234
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r223857 r224029  
    619619@optional
    620620
    621 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;
    622621- (void)clearSelection;
    623622- (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText;
  • trunk/Source/WebKit/UIProcess/PageClient.h

    r221873 r224029  
    303303    virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0;
    304304    virtual bool allowsBlockSelection() = 0;
    305     virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
    306305    virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0;
    307306    virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0;
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r223726 r224029  
    516516    void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&);
    517517    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)>&&);
    518     void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
    519518    void extendSelection(WebCore::TextGranularity);
    520519    void selectWordBackward();
     
    541540    void performActionOnElement(uint32_t action);
    542541    void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize);
    543     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);
    544542    void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&&);
    545543    void setAssistedNodeValue(const String&);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in

    r222941 r224029  
    180180    DidReceivePositionInformation(struct WebKit::InteractionInformationAtPosition information)
    181181    SaveImageToLibrary(WebKit::SharedMemory::Handle handle, uint64_t size)
    182     DidUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
    183182    ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect)
    184183    CommitPotentialTapFailed()
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r223083 r224029  
    133133    void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) override;
    134134    bool allowsBlockSelection() override;
    135     void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;
    136135    void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
    137136
  • trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r224023 r224029  
    575575}
    576576
    577 void PageClientImpl::didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
    578 {
    579     [m_contentView _didUpdateBlockSelectionWithTouch:(SelectionTouch)touch withFlags:(SelectionFlags)flags growThreshold:growThreshold shrinkThreshold:shrinkThreshold];
    580 }
    581 
    582577void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect)
    583578{
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r223726 r224029  
    295295- (void)_overflowScrollingWillBegin;
    296296- (void)_overflowScrollingDidEnd;
    297 - (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
    298297- (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect;
    299298- (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r223726 r224029  
    24792479}
    24802480
    2481 static inline SelectionHandlePosition toSelectionHandlePosition(UIWKHandlePosition position)
    2482 {
    2483     switch (position) {
    2484     case UIWKHandleTop:
    2485         return SelectionHandlePosition::Top;
    2486     case UIWKHandleRight:
    2487         return SelectionHandlePosition::Right;
    2488     case UIWKHandleBottom:
    2489         return SelectionHandlePosition::Bottom;
    2490     case UIWKHandleLeft:
    2491         return SelectionHandlePosition::Left;
    2492     }
    2493 }
    2494 
    24952481static inline WebCore::TextGranularity toWKTextGranularity(UITextGranularity granularity)
    24962482{
     
    25512537}
    25522538
    2553 - (void)_didUpdateBlockSelectionWithTouch:(SelectionTouch)touch withFlags:(SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold
    2554 {
    2555     [_webSelectionAssistant blockSelectionChangedWithTouch:toUIWKSelectionTouch(touch) withFlags:toUIWKSelectionFlags(flags) growThreshold:growThreshold shrinkThreshold:shrinkThreshold];
    2556     if (touch != SelectionTouch::Started && touch != SelectionTouch::Moved)
    2557         _usingGestureForSelection = NO;
    2558 }
    2559 
    25602539- (BOOL)_isInteractingWithAssistedNode
    25612540{
     
    26032582            _usingGestureForSelection = NO;
    26042583    });
    2605 }
    2606 
    2607 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle
    2608 {
    2609     _usingGestureForSelection = YES;
    2610     _page->updateBlockSelectionWithTouch(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), static_cast<uint32_t>(toSelectionHandlePosition(handle)));
    26112584}
    26122585
  • trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r223726 r224029  
    617617}
    618618
    619 void WebPageProxy::updateBlockSelectionWithTouch(const WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition)
    620 {
    621     m_process->send(Messages::WebPage::UpdateBlockSelectionWithTouch(point, touch, handlePosition), m_pageID);
    622 }
    623 
    624619void WebPageProxy::didReceivePositionInformation(const InteractionInformationAtPosition& info)
    625620{
     
    652647    auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize);
    653648    m_pageClient.saveImageToLibrary(WTFMove(buffer));
    654 }
    655 
    656 void WebPageProxy::didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)
    657 {
    658     m_pageClient.didUpdateBlockSelectionWithTouch(touch, flags, growThreshold, shrinkThreshold);
    659649}
    660650
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r223827 r224029  
    551551    void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID);
    552552    void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID);
    553     void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);
    554553    void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID);
    555554    void extendSelection(uint32_t granularity);
     
    10271026    RefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&);
    10281027    void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold);
    1029     RefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);
    10301028    Ref<WebCore::Range> expandedRangeFromHandle(WebCore::Range&, SelectionHandlePosition);
    10311029    Ref<WebCore::Range> contractedRangeFromHandle(WebCore::Range& currentRange, SelectionHandlePosition, SelectionFlags&);
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in

    r223726 r224029  
    5858    SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID)
    5959    UpdateSelectionWithTouches(WebCore::IntPoint point, uint32_t touches, bool baseIsStart, WebKit::CallbackID callbackID)
    60     UpdateBlockSelectionWithTouch(WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition)
    6160    SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WebKit::CallbackID callbackID)
    6261    ExtendSelection(uint32_t granularity)
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r223827 r224029  
    16591659}
    16601660
    1661 static inline bool shouldExpand(SelectionHandlePosition handlePosition, const IntRect& rect, const IntPoint& point)
    1662 {
    1663     switch (handlePosition) {
    1664     case SelectionHandlePosition::Top:
    1665         return (point.y() < rect.y());
    1666     case SelectionHandlePosition::Left:
    1667         return (point.x() < rect.x());
    1668     case SelectionHandlePosition::Right:
    1669         return (point.x() > rect.maxX());
    1670     case SelectionHandlePosition::Bottom:
    1671         return (point.y() > rect.maxY());
    1672     }
    1673 }
    1674 
    1675 RefPtr<WebCore::Range> WebPage::changeBlockSelection(const IntPoint& point, SelectionHandlePosition handlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags& flags)
    1676 {
    1677     Frame& frame = m_page->focusController().focusedOrMainFrame();
    1678     RefPtr<Range> currentRange = m_currentBlockSelection ? m_currentBlockSelection.get() : frame.selection().selection().toNormalizedRange();
    1679     if (!currentRange)
    1680         return nullptr;
    1681     RefPtr<Range> newRange = shouldExpand(handlePosition, selectionBoxForRange(currentRange.get()), point) ? expandedRangeFromHandle(*currentRange, handlePosition) : contractedRangeFromHandle(*currentRange, handlePosition, flags);
    1682 
    1683     if (newRange) {
    1684         m_currentBlockSelection = newRange;
    1685         frame.selection().setSelectedRange(newRange.get(), VP_DEFAULT_AFFINITY, true, UserTriggered);
    1686     }
    1687 
    1688     computeExpandAndShrinkThresholdsForHandle(point, handlePosition, growThreshold, shrinkThreshold);
    1689     return newRange;
    1690 }
    1691 
    1692 void WebPage::updateBlockSelectionWithTouch(const IntPoint& point, uint32_t touch, uint32_t handlePosition)
    1693 {
    1694     Frame& frame = m_page->focusController().focusedOrMainFrame();
    1695     IntPoint adjustedPoint = frame.view()->rootViewToContents(point);
    1696 
    1697     float growThreshold = 0;
    1698     float shrinkThreshold = 0;
    1699     SelectionFlags flags = None;
    1700 
    1701     switch (static_cast<SelectionTouch>(touch)) {
    1702     case SelectionTouch::Started:
    1703         computeExpandAndShrinkThresholdsForHandle(adjustedPoint, static_cast<SelectionHandlePosition>(handlePosition), growThreshold, shrinkThreshold);
    1704         break;
    1705     case SelectionTouch::Ended:
    1706         break;
    1707     case SelectionTouch::Moved:
    1708         changeBlockSelection(adjustedPoint, static_cast<SelectionHandlePosition>(handlePosition), growThreshold, shrinkThreshold, flags);
    1709         break;
    1710     default:
    1711         return;
    1712     }
    1713 
    1714     send(Messages::WebPageProxy::DidUpdateBlockSelectionWithTouch(touch, static_cast<uint32_t>(flags), growThreshold, shrinkThreshold));
    1715 }
    1716 
    17171661void WebPage::clearSelection()
    17181662{
Note: See TracChangeset for help on using the changeset viewer.