Changeset 189944 in webkit


Ignore:
Timestamp:
Sep 17, 2015 4:30:19 PM (9 years ago)
Author:
Beth Dakin
Message:

Heavy taps on links are sometimes interpreted as the preview gesture
https://bugs.webkit.org/show_bug.cgi?id=149304
-and corresponding-
rdar://problem/22689258

Reviewed by Tim Horton.

If the preview gesture starts and stop and less than 250 milliseconds have
passed, then call _attemptClickAtLocation to treat it as a normal tap.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _interactionStartedFromPreviewItemController:]):
(-[WKContentView _interactionStoppedFromPreviewItemController:]):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r189932 r189944  
     12015-09-17  Beth Dakin  <bdakin@apple.com>
     2
     3        Heavy taps on links are sometimes interpreted as the preview gesture
     4        https://bugs.webkit.org/show_bug.cgi?id=149304
     5        -and corresponding-
     6        rdar://problem/22689258
     7
     8        Reviewed by Tim Horton.
     9
     10        If the preview gesture starts and stop and less than 250 milliseconds have
     11        passed, then call _attemptClickAtLocation to treat it as a normal tap.
     12        * UIProcess/ios/WKContentViewInteraction.h:
     13        * UIProcess/ios/WKContentViewInteraction.mm:
     14        (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
     15        (-[WKContentView _interactionStartedFromPreviewItemController:]):
     16        (-[WKContentView _interactionStoppedFromPreviewItemController:]):
     17
    1182015-09-17  Tim Horton  <timothy_horton@apple.com>
    219
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h

    r188053 r189944  
    159159    BOOL _inspectorNodeSearchEnabled;
    160160    BOOL _didAccessoryTabInitiateFocus;
     161
     162    std::chrono::steady_clock::time_point _lastPreviewStartTime;
    161163}
    162164
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r189748 r189944  
    32393239- (BOOL)_interactionShouldBeginFromPreviewItemController:(UIPreviewItemController *)controller forPosition:(CGPoint)position
    32403240{
     3241    _lastPreviewStartTime = std::chrono::steady_clock::now();
     3242
    32413243    if (!_highlightLongPressCanClick)
    32423244        return NO;
     
    33843386- (void)_interactionStoppedFromPreviewItemController:(UIPreviewItemController *)controller
    33853387{
     3388    std::chrono::milliseconds elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - _lastPreviewStartTime);
     3389    if (elapsedTime <= 250_ms)
     3390        [self _attemptClickAtLocation:_positionInformation.point];
     3391
    33863392    [self _addDefaultGestureRecognizers];
    33873393
Note: See TracChangeset for help on using the changeset viewer.