Changeset 211199 in webkit
- Timestamp:
- Jan 25, 2017 8:22:05 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211193 r211199 1 2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add infrastructure to support data interaction in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=167443 5 6 Reviewed by Simon Fraser. 7 8 Adds support in WebCore to determine whether there is interactive data at a given position. No new tests, since 9 there should be no behavior change yet. 10 11 * page/EventHandler.h: 12 * page/Page.cpp: 13 (WebCore::Page::hasDataInteractionAtPosition): 14 * page/Page.h: 15 1 16 2017-01-25 Matt Rajca <mrajca@apple.com> 2 17 -
trunk/Source/WebCore/page/EventHandler.h
r211192 r211199 316 316 static Widget* widgetForEventTarget(Element* eventTarget); 317 317 318 #if ENABLE(DATA_INTERACTION) 319 WEBCORE_EXPORT bool tryToBeginDataInteractionAtPoint(const IntPoint& clientPosition, const IntPoint& globalPosition); 320 #endif 321 318 322 private: 319 323 #if ENABLE(DRAG_SUPPORT) -
trunk/Source/WebCore/page/Page.cpp
r211161 r211199 128 128 #endif 129 129 130 #if ENABLE(DATA_INTERACTION) 131 #include "SelectionRect.h" 132 #endif 133 130 134 namespace WebCore { 131 135 … … 2153 2157 } 2154 2158 2159 #if ENABLE(DATA_INTERACTION) 2160 2161 bool Page::hasDataInteractionAtPosition(const FloatPoint& position) const 2162 { 2163 auto currentSelection = m_mainFrame->selection().selection(); 2164 if (!currentSelection.isRange()) 2165 return false; 2166 2167 if (auto selectedRange = currentSelection.toNormalizedRange()) { 2168 Vector<SelectionRect> selectionRects; 2169 selectedRange->collectSelectionRects(selectionRects); 2170 for (auto selectionRect : selectionRects) { 2171 if (FloatRect(selectionRect.rect()).contains(position)) 2172 return true; 2173 } 2174 } 2175 2176 return false; 2177 } 2178 2179 #endif 2180 2155 2181 } // namespace WebCore -
trunk/Source/WebCore/page/Page.h
r211161 r211199 567 567 bool isUtilityPage() const { return m_isUtilityPage; } 568 568 569 #if ENABLE(DATA_INTERACTION) 570 WEBCORE_EXPORT bool hasDataInteractionAtPosition(const FloatPoint&) const; 571 #endif 572 569 573 private: 570 574 WEBCORE_EXPORT void initGroup(); -
trunk/Source/WebKit2/ChangeLog
r211197 r211199 1 2017-01-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add infrastructure to support data interaction in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=167443 5 6 Reviewed by Simon Fraser. 7 8 Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and 9 WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that 10 indicates whether or not there is data to interact with at a given location. 11 12 This patch only adds infrastructure, and does not change any behavior. 13 14 * Shared/ios/InteractionInformationAtPosition.h: 15 * Shared/ios/InteractionInformationAtPosition.mm: 16 (WebKit::InteractionInformationAtPosition::encode): 17 (WebKit::InteractionInformationAtPosition::decode): 18 * UIProcess/PageClient.h: 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/WebPageProxy.messages.in: 21 * UIProcess/ios/PageClientImplIOS.h: 22 * UIProcess/ios/PageClientImplIOS.mm: 23 (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): 24 (WebKit::PageClientImpl::startDataInteractionWithImage): 25 * UIProcess/ios/WebPageProxyIOS.mm: 26 (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation): 27 (WebKit::requestStartDataInteraction): 28 * UIProcess/mac/PageClientImpl.h: 29 * UIProcess/mac/PageClientImpl.mm: 30 (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation): 31 (WebKit::PageClientImpl::startDataInteractionWithImage): 32 * WebProcess/WebPage/WebPage.cpp: 33 * WebProcess/WebPage/WebPage.h: 34 * WebProcess/WebPage/WebPage.messages.in: 35 * WebProcess/WebPage/ios/WebPageIOS.mm: 36 (WebKit::WebPage::requestStartDataInteraction): 37 (WebKit::WebPage::getPositionInformation): 38 1 39 2017-01-25 Tim Horton <timothy_horton@apple.com> 2 40 -
trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h
r209405 r211199 42 42 43 43 bool nodeAtPositionIsAssistedNode { false }; 44 #if ENABLE(DATA_INTERACTION) 45 bool hasDataInteractionAtPosition { false }; 46 #endif 44 47 bool isSelectable { false }; 45 48 bool isNearMarkedText { false }; -
trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm
r209405 r211199 44 44 45 45 encoder << nodeAtPositionIsAssistedNode; 46 #if ENABLE(DATA_INTERACTION) 47 encoder << hasDataInteractionAtPosition; 48 #endif 46 49 encoder << isSelectable; 47 50 encoder << isNearMarkedText; … … 87 90 if (!decoder.decode(result.nodeAtPositionIsAssistedNode)) 88 91 return false; 92 93 #if ENABLE(DATA_INTERACTION) 94 if (!decoder.decode(result.hasDataInteractionAtPosition)) 95 return false; 96 #endif 89 97 90 98 if (!decoder.decode(result.isSelectable)) -
trunk/Source/WebKit2/UIProcess/PageClient.h
r211172 r211199 381 381 virtual void requestPasswordForQuickLookDocument(const String& fileName, std::function<void(const String&)>&&) = 0; 382 382 #endif 383 384 #if ENABLE(DATA_INTERACTION) 385 virtual void didPerformDataInteractionControllerOperation() = 0; 386 virtual void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, bool isLink) = 0; 387 #endif 383 388 }; 384 389 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r211193 r211199 544 544 void setForceAlwaysUserScalable(bool); 545 545 void setIsScrollingOrZooming(bool); 546 #if ENABLE(DATA_INTERACTION) 547 void didPerformDataInteractionControllerOperation(); 548 void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition); 549 #endif 546 550 #endif 547 551 #if ENABLE(DATA_DETECTION) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r211193 r211199 317 317 #endif 318 318 319 #if ENABLE(DATA_INTERACTION) 320 DidPerformDataInteractionControllerOperation() 321 #endif 322 319 323 #if PLATFORM(COCOA) 320 324 # Dictionary support. -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r211172 r211199 200 200 void requestPasswordForQuickLookDocument(const String& fileName, std::function<void(const String&)>&&) override; 201 201 202 #if ENABLE(DATA_INTERACTION) 203 void didPerformDataInteractionControllerOperation() override; 204 void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, bool isLink) override; 205 #endif 206 202 207 WKContentView *m_contentView; 203 208 WKWebView *m_webView; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r211165 r211199 763 763 } 764 764 765 #if ENABLE(DATA_INTERACTION) 766 void PageClientImpl::didPerformDataInteractionControllerOperation() 767 { 768 } 769 770 void PageClientImpl::startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, bool isLink) 771 { 772 } 773 #endif 774 765 775 void PageClientImpl::handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) 766 776 { -
trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
r211165 r211199 1082 1082 } 1083 1083 1084 #if ENABLE(DATA_INTERACTION) 1085 1086 void WebPageProxy::didPerformDataInteractionControllerOperation() 1087 { 1088 m_pageClient.didPerformDataInteractionControllerOperation(); 1089 } 1090 1091 void WebPageProxy::requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition) 1092 { 1093 if (isValid()) 1094 m_process->send(Messages::WebPage::RequestStartDataInteraction(clientPosition, globalPosition), m_pageID); 1095 } 1096 1097 #endif 1098 1084 1099 #if USE(QUICK_LOOK) 1085 1100 -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h
r210689 r211199 233 233 #endif 234 234 235 #if ENABLE(DATA_INTERACTION) 236 void didPerformDataInteractionControllerOperation() override; 237 void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, bool isLink) override; 238 #endif 239 235 240 NSView *m_view; 236 241 WKWebView *m_webView; -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r210689 r211199 876 876 } 877 877 878 #if ENABLE(DATA_INTERACTION) 879 void PageClientImpl::didPerformDataInteractionControllerOperation() 880 { 881 // FIXME: Implement me. 882 } 883 884 void PageClientImpl::startDataInteractionWithImage(const IntPoint&, const ShareableBitmap::Handle&, bool) 885 { 886 // FIXME: Implement me. 887 } 888 #endif 889 878 890 WebCore::UserInterfaceLayoutDirection PageClientImpl::userInterfaceLayoutDirection() 879 891 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r211161 r211199 3528 3528 3529 3529 m_pendingDropExtensionsForFileUpload.clear(); 3530 #if ENABLE(DATA_INTERACTION) 3531 send(Messages::WebPageProxy::DidPerformDataInteractionControllerOperation()); 3532 #endif 3530 3533 break; 3531 3534 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r211165 r211199 1015 1015 bool shouldSwitchToBlockModeForHandle(const WebCore::IntPoint& handlePoint, SelectionHandlePosition); 1016 1016 RefPtr<WebCore::Range> switchToBlockSelectionAtPoint(const WebCore::IntPoint&, SelectionHandlePosition); 1017 #if ENABLE(DATA_INTERACTION) 1018 void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition); 1019 #endif 1017 1020 #endif 1018 1021 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r211165 r211199 247 247 #endif 248 248 249 #if ENABLE(DATA_INTERACTION) 250 RequestStartDataInteraction(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition) 251 #endif 252 249 253 # Popup menu. 250 254 DidChangeSelectedIndexForActivePopupMenu(int32_t newIndex) -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r211165 r211199 621 621 } 622 622 623 #if ENABLE(DATA_INTERACTION) 624 void WebPage::requestStartDataInteraction(const IntPoint& clientPosition, const IntPoint& globalPosition) 625 { 626 m_page->mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(clientPosition, globalPosition); 627 } 628 #endif 629 623 630 void WebPage::sendTapHighlightForNodeIfNecessary(uint64_t requestID, Node* node) 624 631 { … … 2464 2471 } 2465 2472 } 2473 2474 #if ENABLE(DATA_INTERACTION) 2475 info.hasDataInteractionAtPosition = m_page->hasDataInteractionAtPosition(adjustedPoint); 2476 #endif 2466 2477 } 2467 2478
Note: See TracChangeset
for help on using the changeset viewer.