Changeset 212669 in webkit
- Timestamp:
- Feb 20, 2017 1:21:18 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r212667 r212669 1 2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add plumbing to the UI process for TextIndicatorData when computing the drag image 4 https://bugs.webkit.org/show_bug.cgi?id=168583 5 Work towards <rdar://problem/30313681> 6 7 Reviewed by Tim Horton. 8 9 Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData 10 for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is 11 propagated to the UI process via SetDragImage in the WebDragClient. 12 13 Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose. 14 15 No new tests, since there is no behavior change. 16 17 * page/DragController.cpp: 18 (WebCore::DragController::startDrag): 19 * page/Page.cpp: 20 (WebCore::Page::hasSelectionAtPosition): 21 (WebCore::Page::hasDataInteractionAtPosition): Deleted. 22 * page/Page.h: 23 * platform/DragImage.cpp: 24 (WebCore::createDragImageForSelection): 25 (WebCore::createDragImageForLink): 26 (WebCore::DragImage::operator=): 27 * platform/DragImage.h: 28 * platform/gtk/DragImageGtk.cpp: 29 (WebCore::createDragImageForLink): 30 * platform/mac/DragImageMac.mm: 31 (WebCore::createDragImageForLink): 32 * platform/win/DragImageWin.cpp: 33 (WebCore::createDragImageForLink): 34 1 35 2017-02-20 Brent Fulgham <bfulgham@apple.com> 2 36 -
trunk/Source/WebCore/page/DragController.cpp
r212663 r212669 876 876 m_client.willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, dataTransfer); 877 877 if (!dragImage) { 878 dragImage = DragImage { dissolveDragImageToFraction(createDragImageForSelection(src), DragImageAlpha) }; 878 TextIndicatorData textIndicator; 879 dragImage = DragImage { dissolveDragImageToFraction(createDragImageForSelection(src, textIndicator), DragImageAlpha) }; 880 if (textIndicator.contentImage) 881 dragImage.setIndicatorData(textIndicator); 879 882 dragLoc = dragLocForSelectionDrag(src); 880 883 dragImageAnchorPoint = dragImageAnchorPointForSelectionDrag(src, mouseDraggedPoint); … … 957 960 m_client.willPerformDragSourceAction(DragSourceActionLink, dragOrigin, dataTransfer); 958 961 if (!dragImage) { 959 dragImage = DragImage { createDragImageForLink(linkURL, hitTestResult.textContent(), src.settings().fontRenderingMode()) }; 962 TextIndicatorData textIndicator; 963 dragImage = DragImage { createDragImageForLink(element, linkURL, hitTestResult.textContent(), textIndicator, src.settings().fontRenderingMode(), m_page.deviceScaleFactor()) }; 960 964 IntSize size = dragImageSize(dragImage.get()); 961 965 m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset); 962 966 dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDraggedPoint.y() + m_dragOffset.y()); 963 967 dragImage = DragImage { platformAdjustDragImageForDeviceScaleFactor(dragImage.get(), m_page.deviceScaleFactor()) }; 968 if (textIndicator.contentImage) 969 dragImage.setIndicatorData(textIndicator); 964 970 } 965 971 doSystemDrag(WTFMove(dragImage), dragLoc, mouseDraggedPoint, { }, dataTransfer, src, DragSourceActionLink); … … 979 985 980 986 if (!dragImage) { 981 dragImage = DragImage { dissolveDragImageToFraction(createDragImageForSelection(src), DragImageAlpha) }; 987 TextIndicatorData textIndicator; 988 dragImage = DragImage { dissolveDragImageToFraction(createDragImageForSelection(src, textIndicator), DragImageAlpha) }; 989 if (textIndicator.contentImage) 990 dragImage.setIndicatorData(textIndicator); 982 991 dragLoc = dragLocForSelectionDrag(src); 983 992 m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y()); -
trunk/Source/WebCore/page/Page.cpp
r212173 r212669 2192 2192 #if ENABLE(DATA_INTERACTION) 2193 2193 2194 bool Page::has DataInteractionAtPosition(const FloatPoint& position) const2194 bool Page::hasSelectionAtPosition(const FloatPoint& position) const 2195 2195 { 2196 2196 auto currentSelection = m_mainFrame->selection().selection(); -
trunk/Source/WebCore/page/Page.h
r212173 r212669 572 572 573 573 #if ENABLE(DATA_INTERACTION) 574 WEBCORE_EXPORT bool has DataInteractionAtPosition(const FloatPoint&) const;574 WEBCORE_EXPORT bool hasSelectionAtPosition(const FloatPoint&) const; 575 575 #endif 576 576 -
trunk/Source/WebCore/platform/DragImage.cpp
r212342 r212669 35 35 #include "RenderObject.h" 36 36 #include "RenderView.h" 37 #include "TextIndicator.h" 37 38 38 39 namespace WebCore { … … 123 124 #if !ENABLE(DATA_INTERACTION) 124 125 125 DragImageRef createDragImageForSelection(Frame& frame, bool forceBlackText)126 DragImageRef createDragImageForSelection(Frame& frame, TextIndicatorData&, bool forceBlackText) 126 127 { 127 128 SnapshotOptions options = forceBlackText ? SnapshotOptionsForceBlackText : SnapshotOptionsNone; … … 220 221 221 222 #if !PLATFORM(COCOA) && !PLATFORM(WIN) 222 DragImageRef createDragImageForLink( URL&, const String&, FontRenderingMode)223 DragImageRef createDragImageForLink(Element&, URL&, const String&, FontRenderingMode, float) 223 224 { 224 225 return nullptr; … … 239 240 : m_dragImageRef { std::exchange(other.m_dragImageRef, nullptr) } 240 241 { 242 m_indicatorData = other.m_indicatorData; 241 243 } 242 244 … … 247 249 248 250 m_dragImageRef = std::exchange(other.m_dragImageRef, nullptr); 251 m_indicatorData = other.m_indicatorData; 249 252 250 253 return *this; -
trunk/Source/WebCore/platform/DragImage.h
r212484 r212669 30 30 #include "IntSize.h" 31 31 #include "TextFlags.h" 32 #include "TextIndicator.h" 32 33 #include <wtf/Forward.h> 34 #include <wtf/Optional.h> 33 35 34 36 #if PLATFORM(IOS) … … 49 51 namespace WebCore { 50 52 53 class Element; 51 54 class Frame; 52 55 class Image; … … 84 87 85 88 WEBCORE_EXPORT DragImageRef createDragImageForNode(Frame&, Node&); 86 WEBCORE_EXPORT DragImageRef createDragImageForSelection(Frame&, bool forceBlackText = false);89 WEBCORE_EXPORT DragImageRef createDragImageForSelection(Frame&, TextIndicatorData&, bool forceBlackText = false); 87 90 WEBCORE_EXPORT DragImageRef createDragImageForRange(Frame&, Range&, bool forceBlackText = false); 88 91 DragImageRef createDragImageForImage(Frame&, Node&, IntRect& imageRect, IntRect& elementRect); 89 DragImageRef createDragImageForLink( URL&, const String& label, FontRenderingMode);92 DragImageRef createDragImageForLink(Element&, URL&, const String& label, TextIndicatorData&, FontRenderingMode, float deviceScaleFactor); 90 93 void deleteDragImage(DragImageRef); 91 94 … … 99 102 DragImage& operator=(DragImage&&); 100 103 104 void setIndicatorData(const TextIndicatorData& data) { m_indicatorData = data; } 105 bool hasIndicatorData() const { return !!m_indicatorData; } 106 std::optional<TextIndicatorData> indicatorData() const { return m_indicatorData; } 107 101 108 explicit operator bool() const { return !!m_dragImageRef; } 102 109 DragImageRef get() const { return m_dragImageRef; } … … 104 111 private: 105 112 DragImageRef m_dragImageRef; 113 std::optional<TextIndicatorData> m_indicatorData; 106 114 }; 107 115 -
trunk/Source/WebCore/platform/gtk/DragImageGtk.cpp
r212287 r212669 20 20 #include "DragImage.h" 21 21 22 #include "Element.h" 22 23 #include "Image.h" 24 #include "TextFlags.h" 25 #include "TextIndicator.h" 26 #include "URL.h" 23 27 #include <cairo.h> 24 28 #include <gdk/gdk.h> … … 89 93 } 90 94 95 DragImageRef createDragImageForLink(Element&, URL&, const String&, TextIndicatorData&, FontRenderingMode, float) 96 { 97 return nullptr; 91 98 } 99 100 } -
trunk/Source/WebCore/platform/mac/DragImageMac.mm
r211192 r212669 31 31 #import "BitmapImage.h" 32 32 #import "CoreGraphicsSPI.h" 33 #import "Element.h" 33 34 #import "FontCascade.h" 34 35 #import "FontDescription.h" … … 38 39 #import "URL.h" 39 40 #import "StringTruncator.h" 41 #import "TextIndicator.h" 40 42 #import "TextRun.h" 41 43 #import <wtf/NeverDestroyed.h> … … 266 268 } 267 269 268 DragImageRef createDragImageForLink( URL& url, const String& title, FontRenderingMode)270 DragImageRef createDragImageForLink(Element&, URL& url, const String& title, TextIndicatorData&, FontRenderingMode, float) 269 271 { 270 272 NSString *label = nsStringNilIfEmpty(title); -
trunk/Source/WebCore/platform/win/DragImageWin.cpp
r195180 r212669 27 27 #include "DragImage.h" 28 28 29 #include "Element.h" 29 30 #include "FloatRoundedRect.h" 30 31 #include "FontCascade.h" … … 36 37 #include "URL.h" 37 38 #include "StringTruncator.h" 39 #include "TextIndicator.h" 38 40 #include "TextRun.h" 39 41 #include "WebCoreTextRenderer.h" … … 120 122 } 121 123 122 DragImageRef createDragImageForLink( URL& url, const String& inLabel, FontRenderingMode fontRenderingMode)124 DragImageRef createDragImageForLink(Element&, URL& url, const String& inLabel, TextIndicatorData&, FontRenderingMode fontRenderingMode, float) 123 125 { 124 126 // This is more or less an exact match for the Mac OS X code. -
trunk/Source/WebKit/mac/ChangeLog
r212663 r212669 1 2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add plumbing to the UI process for TextIndicatorData when computing the drag image 4 https://bugs.webkit.org/show_bug.cgi?id=168583 5 Work towards <rdar://problem/30313681> 6 7 Accounts for changes in WebCore -- see Source/WebCore/ChangeLog for more details. 8 9 Reviewed by Tim Horton. 10 11 * WebView/WebHTMLView.mm: 12 (-[WebHTMLView _selectionDraggingImage]): 13 (-[WebHTMLView selectionImageForcingBlackText:selectionImageForcingBlackText:]): 14 1 15 2017-02-17 Anders Carlsson <andersca@apple.com> 2 16 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r212663 r212669 2390 2390 return nil; 2391 2391 2392 auto dragImage = createDragImageForSelection(*coreFrame); 2392 TextIndicatorData textIndicator; 2393 auto dragImage = createDragImageForSelection(*coreFrame, textIndicator); 2393 2394 [dragImage _web_dissolveToFraction:WebDragImageAlpha]; 2394 2395 … … 7374 7375 return selectionImage(coreFrame, forceBlackText); 7375 7376 #else 7376 return createDragImageForSelection(*coreFrame, forceBlackText).autorelease(); 7377 TextIndicatorData textIndicator; 7378 return createDragImageForSelection(*coreFrame, textIndicator, forceBlackText).autorelease(); 7377 7379 #endif 7378 7380 } -
trunk/Source/WebKit2/ChangeLog
r212666 r212669 1 2017-02-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add plumbing to the UI process for TextIndicatorData when computing the drag image 4 https://bugs.webkit.org/show_bug.cgi?id=168583 5 Work towards <rdar://problem/30313681> 6 7 Reviewed by Tim Horton. 8 9 Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean 10 isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to 11 special case links. 12 13 Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose. 14 15 These changes are only infrastructural should not alter any behaviors. 16 17 * Shared/ios/InteractionInformationAtPosition.h: 18 * Shared/ios/InteractionInformationAtPosition.mm: 19 (WebKit::InteractionInformationAtPosition::encode): 20 (WebKit::InteractionInformationAtPosition::decode): 21 * UIProcess/API/Cocoa/WKWebView.mm: 22 (-[WKWebView _simulateDataInteractionGestureRecognized]): 23 (-[WKWebView _simulateDataInteractionEntered:]): 24 (-[WKWebView _simulateDataInteractionUpdated:]): 25 (-[WKWebView _simulateDataInteractionPerformOperation:]): 26 (-[WKWebView _simulateDataInteractionEnded:]): 27 (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): 28 (-[WKWebView _simulateFailedDataInteractionWithIndex:]): 29 (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): 30 (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): 31 * UIProcess/API/Cocoa/_WKTestingDelegate.h: 32 * UIProcess/PageClient.h: 33 * UIProcess/WebPageProxy.h: 34 * UIProcess/WebPageProxy.messages.in: 35 * UIProcess/ios/PageClientImplIOS.h: 36 * UIProcess/ios/PageClientImplIOS.mm: 37 (WebKit::PageClientImpl::setDragImage): 38 (WebKit::PageClientImpl::startDataInteractionWithImage): 39 * UIProcess/ios/WKContentViewInteraction.h: 40 * UIProcess/ios/WKContentViewInteraction.mm: 41 (-[WKContentView hasSelectablePositionAtPoint:]): 42 (-[WKContentView pointIsInDataInteractionContent:]): 43 (-[WKContentView _dataInteractionGestureRecognizer]): 44 (-[WKContentView pointIsInAssistedNode:]): 45 * UIProcess/mac/PageClientImpl.h: 46 * UIProcess/mac/PageClientImpl.mm: 47 (WebKit::PageClientImpl::setDragImage): 48 * UIProcess/mac/WebPageProxyMac.mm: 49 (WebKit::WebPageProxy::setDragImage): 50 * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: 51 (WebKit::WebDragClient::startDrag): 52 * WebProcess/WebPage/ios/WebPageIOS.mm: 53 (WebKit::WebPage::getPositionInformation): 54 1 55 2017-02-20 David Quesada <david_quesada@apple.com> 2 56 -
trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.h
r212342 r212669 43 43 bool nodeAtPositionIsAssistedNode { false }; 44 44 #if ENABLE(DATA_INTERACTION) 45 bool has DataInteractionAtPosition { false };45 bool hasSelectionAtPosition { false }; 46 46 #endif 47 47 bool isSelectable { false }; -
trunk/Source/WebKit2/Shared/ios/InteractionInformationAtPosition.mm
r212342 r212669 45 45 encoder << nodeAtPositionIsAssistedNode; 46 46 #if ENABLE(DATA_INTERACTION) 47 encoder << has DataInteractionAtPosition;47 encoder << hasSelectionAtPosition; 48 48 #endif 49 49 encoder << isSelectable; … … 93 93 94 94 #if ENABLE(DATA_INTERACTION) 95 if (!decoder.decode(result.has DataInteractionAtPosition))95 if (!decoder.decode(result.hasSelectionAtPosition)) 96 96 return false; 97 97 #endif -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r212459 r212669 5175 5175 - (void)_simulateDataInteractionGestureRecognized 5176 5176 { 5177 #if ENABLE(DATA_INTERACTION)5178 [_contentView _simulateDataInteractionGestureRecognized:_testingDelegate.dataInteractionGestureRecognizer];5179 #endif5180 5177 } 5181 5178 5182 5179 - (void)_simulateDataInteractionEntered:(id)info 5183 5180 { 5184 #if ENABLE(DATA_INTERACTION)5185 [_contentView _simulateDataInteractionEntered:info];5186 #endif5187 5181 } 5188 5182 5189 5183 - (void)_simulateDataInteractionUpdated:(id)info 5190 5184 { 5191 #if ENABLE(DATA_INTERACTION)5192 [_contentView _simulateDataInteractionUpdated:info];5193 #endif5194 5185 } 5195 5186 5196 5187 - (void)_simulateDataInteractionPerformOperation:(id)info 5197 5188 { 5198 #if ENABLE(DATA_INTERACTION)5199 [_contentView _simulateDataInteractionPerformOperation:info];5200 #endif5201 5189 } 5202 5190 5203 5191 - (void)_simulateDataInteractionEnded:(id)info 5204 5192 { 5205 #if ENABLE(DATA_INTERACTION)5206 [_contentView _simulateDataInteractionEnded:info];5207 #endif5208 5193 } 5209 5194 5210 5195 - (void)_simulateDataInteractionSessionDidEnd:(id)session withOperation:(NSUInteger)operation 5211 5196 { 5212 #if ENABLE(DATA_INTERACTION)5213 [_contentView _simulateDataInteractionSessionDidEnd:session withOperation:operation];5214 #endif5215 5197 } 5216 5198 5217 5199 - (void)_simulateFailedDataInteractionWithIndex:(NSInteger)sourceIndex 5218 5200 { 5219 #if ENABLE(DATA_INTERACTION)5220 [_contentView _simulateFailedDataInteractionWithIndex:sourceIndex];5221 #endif5222 5201 } 5223 5202 5224 5203 - (void)_simulateWillBeginDataInteractionWithIndex:(NSInteger)sourceIndex withSession:(id)session 5225 5204 { 5226 #if ENABLE(DATA_INTERACTION)5227 [_contentView _simulateWillBeginDataInteractionWithIndex:sourceIndex withSession:session];5228 #endif5229 5205 } 5230 5206 5231 5207 - (NSArray *)_simulatedItemsForDataInteractionWithIndex:(NSInteger)sourceIndex 5232 5208 { 5233 #if ENABLE(DATA_INTERACTION)5234 return [_contentView _simulatedItemsForDataInteractionWithIndex:sourceIndex];5235 #else5236 5209 return @[ ]; 5237 #endif5238 5210 } 5239 5211 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKTestingDelegate.h
r212507 r212669 32 32 @class WKWebView; 33 33 34 #if TARGET_OS_IPHONE35 @class UIGestureRecognizer;36 @class UILongPressGestureRecognizer;37 #endif38 39 34 NS_ASSUME_NONNULL_BEGIN 40 35 … … 43 38 44 39 #if TARGET_OS_IPHONE 45 @property (nonatomic, readonly) UILongPressGestureRecognizer *dataInteractionGestureRecognizer;46 - (void)webViewDidSendDataInteractionStartRequest:(WKWebView *)webView;47 - (void)webView:(WKWebView *)webView didReceiveDataInteractionStartResponse:(BOOL)started;48 40 - (void)webViewDidPerformDataInteractionControllerOperation:(WKWebView *)webView; 49 - (void)webView:(WKWebView *)webView beginDataInteractionWithSourceIndex:(NSInteger)sourceIndex gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer;50 41 #endif // TARGET_OS_PHONE 51 42 -
trunk/Source/WebKit2/UIProcess/PageClient.h
r212557 r212669 171 171 virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&) = 0; 172 172 virtual bool executeSavedCommandBySelector(const String& selector) = 0; 173 virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) = 0;173 virtual void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) = 0; 174 174 virtual void updateSecureInputState() = 0; 175 175 virtual void resetSecureInputState() = 0; … … 381 381 virtual void didPerformDataInteractionControllerOperation() = 0; 382 382 virtual void didHandleStartDataInteractionRequest(bool started) = 0; 383 virtual void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, const WebCore::FloatPoint& anchorPoint, bool isLink) = 0;383 virtual void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, std::optional<WebCore::TextIndicatorData>, const WebCore::FloatPoint& anchorPoint, uint64_t action) = 0; 384 384 #endif 385 385 }; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r212619 r212669 833 833 void dragCancelled(); 834 834 #if PLATFORM(COCOA) 835 void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, const WebCore::FloatPoint& dragImageAnchor, bool isLinkDrag);835 void setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, std::optional<WebCore::TextIndicatorData>, const WebCore::FloatPoint& dragImageAnchor, uint64_t action); 836 836 void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension, 837 837 const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r212608 r212669 303 303 #endif 304 304 #if PLATFORM(COCOA) && ENABLE(DRAG_SUPPORT) 305 SetDragImage(WebCore::IntPoint clientPosition, WebKit::ShareableBitmap::Handle dragImage, WebCore::FloatPoint dragImageAnchor, bool linkDrag)305 SetDragImage(WebCore::IntPoint clientPosition, WebKit::ShareableBitmap::Handle dragImage, std::optional<WebCore::TextIndicatorData> textIndicator, WebCore::FloatPoint dragImageAnchor, uint64_t action) 306 306 SetPromisedDataForImage(String pasteboardName, WebKit::SharedMemory::Handle imageHandle, uint64_t imageSize, String filename, String extension, String title, String url, String visibleURL, WebKit::SharedMemory::Handle archiveHandle, uint64_t archiveSize) 307 307 #if ENABLE(ATTACHMENT_ELEMENT) -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r212325 r212669 79 79 void accessibilityWebProcessTokenReceived(const IPC::DataReference&) override; 80 80 bool executeSavedCommandBySelector(const String& selector) override; 81 void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) override;81 void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) override; 82 82 void updateSecureInputState() override; 83 83 void resetSecureInputState() override; … … 205 205 void didPerformDataInteractionControllerOperation() override; 206 206 void didHandleStartDataInteractionRequest(bool started) override; 207 void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, const WebCore::FloatPoint& anchorPoint, bool isLink) override;207 void startDataInteractionWithImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& image, std::optional<WebCore::TextIndicatorData>, const WebCore::FloatPoint& anchorPoint, uint64_t action) override; 208 208 #endif 209 209 -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r212325 r212669 354 354 } 355 355 356 void PageClientImpl::setDragImage(const IntPoint&, PassRefPtr<ShareableBitmap>, bool)356 void PageClientImpl::setDragImage(const IntPoint&, PassRefPtr<ShareableBitmap>, DragSourceAction) 357 357 { 358 358 notImplemented(); … … 774 774 } 775 775 776 void PageClientImpl::startDataInteractionWithImage(const IntPoint& clientPosition, const ShareableBitmap::Handle& image, const FloatPoint& anchorPoint, bool isLink)777 { 778 [m_contentView _startDataInteractionWithImage:ShareableBitmap::create(image)->makeCGImageCopy() atClientPosition:CGPointMake(clientPosition.x(), clientPosition.y()) anchorPoint:anchorPoint isLink:isLink];776 void PageClientImpl::startDataInteractionWithImage(const IntPoint& clientPosition, const ShareableBitmap::Handle& image, std::optional<WebCore::TextIndicatorData> indicatorData, const FloatPoint& anchorPoint, uint64_t action) 777 { 778 [m_contentView _startDataInteractionWithImage:ShareableBitmap::create(image)->makeCGImageCopy() withIndicatorData:indicatorData atClientPosition:CGPointMake(clientPosition.x(), clientPosition.y()) anchorPoint:anchorPoint action:action]; 779 779 } 780 780 #endif -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r212376 r212669 271 271 - (void)_didPerformDataInteractionControllerOperation; 272 272 - (void)_didHandleStartDataInteractionRequest:(BOOL)started; 273 - (void)_startDataInteractionWithImage:(RetainPtr<CGImageRef>)image atClientPosition:(CGPoint)clientPosition anchorPoint:(CGPoint)anchorPoint isLink:(BOOL)isLink;273 - (void)_startDataInteractionWithImage:(RetainPtr<CGImageRef>)image withIndicatorData:(std::optional<WebCore::TextIndicatorData>)indicatorData atClientPosition:(CGPoint)clientPosition anchorPoint:(CGPoint)anchorPoint action:(uint64_t)action; 274 274 - (void)_simulateDataInteractionGestureRecognized:(UILongPressGestureRecognizer *)gestureRecognizer WK_API_AVAILABLE(ios(WK_IOS_TBA)); 275 275 - (void)_simulateDataInteractionEntered:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA)); -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r212459 r212669 1442 1442 1443 1443 #if ENABLE(DATA_INTERACTION) 1444 if (_positionInformation.has DataInteractionAtPosition) {1444 if (_positionInformation.hasSelectionAtPosition) { 1445 1445 // If the position might initiate a data interaction, we don't want to consider the content at this position to be selectable. 1446 1446 // FIXME: This should be renamed to something more precise, such as textSelectionShouldRecognizeGestureAtPoint: … … 1462 1462 return YES; 1463 1463 1464 return _positionInformation.has DataInteractionAtPosition;1464 return _positionInformation.hasSelectionAtPosition; 1465 1465 } 1466 1466 1467 1467 - (UILongPressGestureRecognizer *)_dataInteractionGestureRecognizer 1468 1468 { 1469 if ([_webView._testingDelegate respondsToSelector:@selector(dataInteractionGestureRecognizer)])1470 return _webView._testingDelegate.dataInteractionGestureRecognizer;1471 1472 1469 return _dataInteractionGestureRecognizer.get(); 1473 1470 } … … 1488 1485 1489 1486 #if ENABLE(DATA_INTERACTION) 1490 if (_positionInformation.has DataInteractionAtPosition) {1487 if (_positionInformation.hasSelectionAtPosition) { 1491 1488 // If the position might initiate data interaction, we don't want to change the selection. 1492 1489 // FIXME: This should be renamed to something more precise, such as textInteractionShouldRecognizeGestureAtPoint: -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h
r212325 r212669 96 96 void executeUndoRedo(WebPageProxy::UndoOrRedo) override; 97 97 bool executeSavedCommandBySelector(const String& selector) override; 98 void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag) override;98 void setDragImage(const WebCore::IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, WebCore::DragSourceAction) override; 99 99 void setPromisedDataForImage(const String& pasteboardName, PassRefPtr<WebCore::SharedBuffer> imageBuffer, const String& filename, const String& extension, const String& title, 100 100 const String& url, const String& visibleUrl, PassRefPtr<WebCore::SharedBuffer> archiveBuffer) override; -
trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm
r212325 r212669 338 338 } 339 339 340 void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, bool isLinkDrag)340 void PageClientImpl::setDragImage(const IntPoint& clientPosition, PassRefPtr<ShareableBitmap> dragImage, DragSourceAction action) 341 341 { 342 342 RetainPtr<CGImageRef> dragCGImage = dragImage->makeCGImage(); … … 346 346 [dragNSImage setSize:size]; 347 347 348 m_impl->dragImageForView(m_view, dragNSImage.get(), clientPosition, isLinkDrag);348 m_impl->dragImageForView(m_view, dragNSImage.get(), clientPosition, action == DragSourceActionLink); 349 349 } 350 350 -
trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
r212325 r212669 270 270 271 271 #if ENABLE(DRAG_SUPPORT) 272 void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, const FloatPoint&, bool isLinkDrag)272 void WebPageProxy::setDragImage(const WebCore::IntPoint& clientPosition, const ShareableBitmap::Handle& dragImageHandle, std::optional<TextIndicatorData>, const FloatPoint&, uint64_t action) 273 273 { 274 274 if (auto dragImage = ShareableBitmap::create(dragImageHandle)) 275 m_pageClient.setDragImage(clientPosition, WTFMove(dragImage), isLinkDrag);275 m_pageClient.setDragImage(clientPosition, WTFMove(dragImage), static_cast<DragSourceAction>(action)); 276 276 277 277 process().send(Messages::WebPage::DidStartDrag(), m_pageID); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
r212379 r212669 94 94 95 95 // FIXME: Seems this message should be named StartDrag, not SetDragImage. 96 m_page->send(Messages::WebPageProxy::SetDragImage(frame.view()->contentsToWindow(point), handle, { }, dragSourceAction == DragSourceActionLink));96 m_page->send(Messages::WebPageProxy::SetDragImage(frame.view()->contentsToWindow(point), handle, std::nullopt, { }, dragSourceAction)); 97 97 } 98 98 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r212342 r212669 2550 2550 2551 2551 #if ENABLE(DATA_INTERACTION) 2552 info.has DataInteractionAtPosition = m_page->hasDataInteractionAtPosition(adjustedPoint);2552 info.hasSelectionAtPosition = m_page->hasSelectionAtPosition(adjustedPoint); 2553 2553 #endif 2554 2554 info.adjustedPointForNodeRespondingToClickEvents = adjustedPoint;
Note: See TracChangeset
for help on using the changeset viewer.