⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 233569 in webkit


Ignore:
Timestamp:
Jul 5, 2018, 11:43:24 PM (8 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r233546. rdar://problem/41867306

Upstream hover gesture implementation
​https://bugs.webkit.org/show_bug.cgi?id=187366

Reviewed by Wenson Hsieh.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView _hoverGestureRecognizerChanged:]):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@233546 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-606.1.24-branch/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-606.1.24-branch/Source/WebKit/ChangeLog

    r233512 r233569  
     12018-07-05  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r233546. rdar://problem/41867306
     4
     5    Upstream hover gesture implementation
     6    https://bugs.webkit.org/show_bug.cgi?id=187366
     7   
     8    Reviewed by Wenson Hsieh.
     9   
     10    * UIProcess/ios/WKContentViewInteraction.h:
     11    * UIProcess/ios/WKContentViewInteraction.mm:
     12    (-[WKContentView setupInteraction]):
     13    (-[WKContentView cleanupInteraction]):
     14    (-[WKContentView _removeDefaultGestureRecognizers]):
     15    (-[WKContentView _addDefaultGestureRecognizers]):
     16    (-[WKContentView _hoverGestureRecognizerChanged:]):
     17   
     18   
     19    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     20
     21    2018-07-05  Tim Horton  <timothy_horton@apple.com>
     22
     23            Upstream hover gesture implementation
     24            https://bugs.webkit.org/show_bug.cgi?id=187366
     25
     26            Reviewed by Wenson Hsieh.
     27
     28            * UIProcess/ios/WKContentViewInteraction.h:
     29            * UIProcess/ios/WKContentViewInteraction.mm:
     30            (-[WKContentView setupInteraction]):
     31            (-[WKContentView cleanupInteraction]):
     32            (-[WKContentView _removeDefaultGestureRecognizers]):
     33            (-[WKContentView _addDefaultGestureRecognizers]):
     34            (-[WKContentView _hoverGestureRecognizerChanged:]):
     35
    1362018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
    237
  • branches/safari-606.1.24-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r232968 r233569  
    7878}
    7979
     80@class _UIHighlightView;
     81@class _UIWebHighlightLongPressGestureRecognizer;
     82@class UIHoverGestureRecognizer;
     83@class WebEvent;
    8084@class WKActionSheetAssistant;
     85@class WKFocusedFormControlView;
    8186@class WKFormInputSession;
    8287@class WKInspectorNodeSearchGestureRecognizer;
    83 @class WebEvent;
    84 @class _UIHighlightView;
    85 @class _UIWebHighlightLongPressGestureRecognizer;
    86 
    87 #if USE(APPLE_INTERNAL_SDK)
    88 #import <WebKitAdditions/WKContentViewInteractionAdditionsBefore.h>
    89 #endif
    90 
    91 #if PLATFORM(WATCHOS)
    92 @class WKFocusedFormControlView;
    93 #endif
    9488
    9589typedef void (^UIWKAutocorrectionCompletionHandler)(UIWKAutocorrectionRects *rectsForInput);
    … …  
    152146    BOOL _canSendTouchEventsAsynchronously;
    153147
    154 #if USE(APPLE_INTERNAL_SDK)
    155 #import <WebKitAdditions/WKContentViewInteractionAdditionsAfter.h>
    156 #endif
    157 
    158148    RetainPtr<WKSyntheticClickTapGestureRecognizer> _singleTapGestureRecognizer;
    159149    RetainPtr<_UIWebHighlightLongPressGestureRecognizer> _highlightLongPressGestureRecognizer;
    … …  
    164154    RetainPtr<UITapGestureRecognizer> _twoFingerSingleTapGestureRecognizer;
    165155    RetainPtr<WKInspectorNodeSearchGestureRecognizer> _inspectorNodeSearchGestureRecognizer;
     156
     157#if PLATFORM(IOSMAC)
     158    RetainPtr<UIHoverGestureRecognizer> _hoverGestureRecognizer;
     159#endif
    166160
    167161    RetainPtr<UIWKTextInteractionAssistant> _textSelectionAssistant;
  • branches/safari-606.1.24-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r233501 r233569  
    106106#endif
    107107
    108 #if USE(APPLE_INTERNAL_SDK)
    109 #import <WebKitAdditions/WKContentViewInteractionAdditionsBefore.mm>
     108#if PLATFORM(IOSMAC)
     109#import "NativeWebMouseEvent.h"
     110#import <UIKit/UIHoverGestureRecognizer.h>
     111#import <pal/spi/ios/GraphicsServicesSPI.h>
    110112#endif
    111113
    … …  
    618620    [self addGestureRecognizer:_touchEventGestureRecognizer.get()];
    619621
    620 #if USE(APPLE_INTERNAL_SDK)
    621     [self _internalSetupInteraction];
     622#if PLATFORM(IOSMAC)
     623    _hoverGestureRecognizer = adoptNS([[UIHoverGestureRecognizer alloc] initWithTarget:self action:@selector(_hoverGestureRecognizerChanged:)]);
     624    [_hoverGestureRecognizer setDelegate:self];
     625    [self addGestureRecognizer:_hoverGestureRecognizer.get()];
    622626#endif
    623627
    … …  
    712716    [self removeGestureRecognizer:_touchEventGestureRecognizer.get()];
    713717
    714 #if USE(APPLE_INTERNAL_SDK)
    715     [self _internalCleanupInteraction];
     718#if PLATFORM(IOSMAC)
     719    [_hoverGestureRecognizer setDelegate:nil];
     720    [self removeGestureRecognizer:_hoverGestureRecognizer.get()];
    716721#endif
    717722
    … …  
    776781    [self removeGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()];
    777782    [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
    778 
    779 #if USE(APPLE_INTERNAL_SDK)
    780     [self _internalRemoveDefaultGestureRecognizers];
     783#if PLATFORM(IOSMAC)
     784    [self removeGestureRecognizer:_hoverGestureRecognizer.get()];
    781785#endif
    782786}
    … …  
    791795    [self addGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()];
    792796    [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
    793 
    794 #if USE(APPLE_INTERNAL_SDK)
    795     [self _internalAddDefaultGestureRecognizers];
     797#if PLATFORM(IOSMAC)
     798    [self addGestureRecognizer:_hoverGestureRecognizer.get()];
    796799#endif
    797800}
    … …  
    56585661#endif // PLATFORM(WATCHOS)
    56595662
    5660 #if USE(APPLE_INTERNAL_SDK)
    5661 #import <WebKitAdditions/WKContentViewInteractionAdditionsAfter.mm>
     5663#if PLATFORM(IOSMAC)
     5664- (void)_hoverGestureRecognizerChanged:(UIGestureRecognizer *)gestureRecognizer
     5665{
     5666    if (!_page->isValid())
     5667        return;
     5668
     5669    // Make a timestamp that matches UITouch and UIEvent.
     5670    CFTimeInterval timestamp = GSCurrentEventTimestamp() / 1000000000.0;
     5671
     5672    CGPoint point;
     5673    switch (gestureRecognizer.state) {
     5674    case UIGestureRecognizerStateBegan:
     5675    case UIGestureRecognizerStateChanged:
     5676        point = [gestureRecognizer locationInView:self];
     5677        break;
     5678    case UIGestureRecognizerStateEnded:
     5679    case UIGestureRecognizerStateCancelled:
     5680    default:
     5681        point = CGPointMake(-1, -1);
     5682        break;
     5683    }
     5684
     5685    auto event = adoptNS([[::WebEvent alloc] initWithMouseEventType:WebEventMouseMoved timeStamp:timestamp location:point]);
     5686    _page->handleMouseEvent(NativeWebMouseEvent(event.get()));
     5687}
    56625688#endif
    56635689
Note: See TracChangeset for help on using the changeset viewer.