Changeset 218380 in webkit


Ignore:
Timestamp:
Jun 15, 2017 9:06:04 PM (7 years ago)
Author:
Wenson Hsieh
Message:

[iOS DnD] [WK1] Dropping links onto UIWebViews should not trigger navigation by default
https://bugs.webkit.org/show_bug.cgi?id=173454
<rdar://problem/31720671>

Reviewed by Tim Horton.

Adds -webView:dragDestinationActionMaskForSession: as SPI to WebUIDelegate.
If unimplemented, the default UI delegate allows all actions except for URL loading.

  • DefaultDelegates/WebDefaultUIDelegate.mm:

(-[WebDefaultUIDelegate webView:dragDestinationActionMaskForSession:]):

  • WebView/WebUIDelegatePrivate.h:
  • WebView/WebView.mm:

(-[WebView dragDestinationActionMaskForSession:]):

Location:
trunk/Source/WebKit/mac
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r218343 r218380  
     12017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS DnD] [WK1] Dropping links onto UIWebViews should not trigger navigation by default
     4        https://bugs.webkit.org/show_bug.cgi?id=173454
     5        <rdar://problem/31720671>
     6
     7        Reviewed by Tim Horton.
     8
     9        Adds -webView:dragDestinationActionMaskForSession: as SPI to WebUIDelegate.
     10        If unimplemented, the default UI delegate allows all actions except for URL loading.
     11
     12        * DefaultDelegates/WebDefaultUIDelegate.mm:
     13        (-[WebDefaultUIDelegate webView:dragDestinationActionMaskForSession:]):
     14        * WebView/WebUIDelegatePrivate.h:
     15        * WebView/WebView.mm:
     16        (-[WebView dragDestinationActionMaskForSession:]):
     17
    1182017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/Source/WebKit/mac/DefaultDelegates/WebDefaultUIDelegate.mm

    r214403 r218380  
    271271{
    272272}
     273
     274#if ENABLE(DRAG_SUPPORT)
     275- (WebDragDestinationAction)webView:(WebView *)sender dragDestinationActionMaskForSession:(id <UIDropSession>)session
     276{
     277    return WebDragDestinationActionAny & ~WebDragDestinationActionLoad;
     278}
     279#endif
    273280#endif
    274281
  • trunk/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r212797 r218380  
    4444#define ENABLE_FULLSCREEN_API 0
    4545#endif
     46#endif
     47
     48#if TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
     49@protocol UIDropSession;
    4650#endif
    4751
     
    291295
    292296- (BOOL)webViewCanCheckGeolocationAuthorizationStatus:(WebView *)sender;
     297
     298#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
     299/*!
     300 @method webView:dragDestinationActionMaskForSession:
     301 @param sender The WebView sending the delegate method
     302 @param session The drop session which this destination action mask will affect
     303 @abstract May be implemented to adjust which destination actions are allowed upon dropping the given session.
     304 */
     305- (WebDragDestinationAction)webView:(WebView *)sender dragDestinationActionMaskForSession:(id <UIDropSession>)session;
     306#endif
    293307#endif
    294308
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r218196 r218380  
    18991899}
    19001900
     1901- (WebDragDestinationAction)dragDestinationActionMaskForSession:(id <UIDropSession>)session
     1902{
     1903    return [self._UIDelegateForwarder webView:self dragDestinationActionMaskForSession:session];
     1904}
     1905
    19011906#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WebViewAdditions.mm>)
    19021907#include <WebKitAdditions/WebViewAdditions.mm>
Note: See TracChangeset for help on using the changeset viewer.