Changeset 224029 in webkit
- Timestamp:
- Oct 26, 2017 11:20:14 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r224024 r224029 1 2017-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 1 33 2017-10-26 Ryan Haddad <ryanhaddad@apple.com> 2 34 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r223857 r224029 619 619 @optional 620 620 621 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle;622 621 - (void)clearSelection; 623 622 - (void)replaceDictatedText:(NSString *)oldText withText:(NSString *)newText; -
trunk/Source/WebKit/UIProcess/PageClient.h
r221873 r224029 303 303 virtual void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) = 0; 304 304 virtual bool allowsBlockSelection() = 0; 305 virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;306 305 virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0; 307 306 virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0; -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r223726 r224029 516 516 void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, CallbackBase::Error)>&&); 517 517 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);519 518 void extendSelection(WebCore::TextGranularity); 520 519 void selectWordBackward(); … … 541 540 void performActionOnElement(uint32_t action); 542 541 void saveImageToLibrary(const SharedMemory::Handle& imageHandle, uint64_t imageSize); 543 void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold);544 542 void focusNextAssistedNode(bool isForward, WTF::Function<void (CallbackBase::Error)>&&); 545 543 void setAssistedNodeValue(const String&); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r222941 r224029 180 180 DidReceivePositionInformation(struct WebKit::InteractionInformationAtPosition information) 181 181 SaveImageToLibrary(WebKit::SharedMemory::Handle handle, uint64_t size) 182 DidUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold)183 182 ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect) 184 183 CommitPotentialTapFailed() -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r223083 r224029 133 133 void saveImageToLibrary(Ref<WebCore::SharedBuffer>&&) override; 134 134 bool allowsBlockSelection() override; 135 void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) override;136 135 void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override; 137 136 -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r224023 r224029 575 575 } 576 576 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 582 577 void PageClientImpl::showPlaybackTargetPicker(bool hasVideo, const IntRect& elementRect) 583 578 { -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r223726 r224029 295 295 - (void)_overflowScrollingWillBegin; 296 296 - (void)_overflowScrollingDidEnd; 297 - (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;298 297 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect; 299 298 - (void)_showRunOpenPanel:(API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r223726 r224029 2479 2479 } 2480 2480 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 2495 2481 static inline WebCore::TextGranularity toWKTextGranularity(UITextGranularity granularity) 2496 2482 { … … 2551 2537 } 2552 2538 2553 - (void)_didUpdateBlockSelectionWithTouch:(SelectionTouch)touch withFlags:(SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold2554 {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 2560 2539 - (BOOL)_isInteractingWithAssistedNode 2561 2540 { … … 2603 2582 _usingGestureForSelection = NO; 2604 2583 }); 2605 }2606 2607 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle2608 {2609 _usingGestureForSelection = YES;2610 _page->updateBlockSelectionWithTouch(WebCore::IntPoint(point), static_cast<uint32_t>(toSelectionTouch(touch)), static_cast<uint32_t>(toSelectionHandlePosition(handle)));2611 2584 } 2612 2585 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r223726 r224029 617 617 } 618 618 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 624 619 void WebPageProxy::didReceivePositionInformation(const InteractionInformationAtPosition& info) 625 620 { … … 652 647 auto buffer = SharedBuffer::create(static_cast<unsigned char*>(sharedMemoryBuffer->data()), imageSize); 653 648 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);659 649 } 660 650 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r223827 r224029 551 551 void selectWithGesture(const WebCore::IntPoint&, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, CallbackID); 552 552 void updateSelectionWithTouches(const WebCore::IntPoint&, uint32_t touches, bool baseIsStart, CallbackID); 553 void updateBlockSelectionWithTouch(const WebCore::IntPoint&, uint32_t touch, uint32_t handlePosition);554 553 void selectWithTwoTouches(const WebCore::IntPoint& from, const WebCore::IntPoint& to, uint32_t gestureType, uint32_t gestureState, CallbackID); 555 554 void extendSelection(uint32_t granularity); … … 1027 1026 RefPtr<WebCore::Range> rangeForBlockAtPoint(const WebCore::IntPoint&); 1028 1027 void computeExpandAndShrinkThresholdsForHandle(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold); 1029 RefPtr<WebCore::Range> changeBlockSelection(const WebCore::IntPoint&, SelectionHandlePosition, float& growThreshold, float& shrinkThreshold, SelectionFlags&);1030 1028 Ref<WebCore::Range> expandedRangeFromHandle(WebCore::Range&, SelectionHandlePosition); 1031 1029 Ref<WebCore::Range> contractedRangeFromHandle(WebCore::Range& currentRange, SelectionHandlePosition, SelectionFlags&); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r223726 r224029 58 58 SelectWithGesture(WebCore::IntPoint point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithAssistedNode, WebKit::CallbackID callbackID) 59 59 UpdateSelectionWithTouches(WebCore::IntPoint point, uint32_t touches, bool baseIsStart, WebKit::CallbackID callbackID) 60 UpdateBlockSelectionWithTouch(WebCore::IntPoint point, uint32_t touch, uint32_t handlePosition)61 60 SelectWithTwoTouches(WebCore::IntPoint from, WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WebKit::CallbackID callbackID) 62 61 ExtendSelection(uint32_t granularity) -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r223827 r224029 1659 1659 } 1660 1660 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 1717 1661 void WebPage::clearSelection() 1718 1662 {
Note: See TracChangeset
for help on using the changeset viewer.