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

Changeset 243543 in webkit


Ignore:
Timestamp:
Mar 27, 2019, 8:46:26 AM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r243454. rdar://problem/48702444

Animated keyboard scrolling is extremely chaotic
https://bugs.webkit.org/show_bug.cgi?id=196164
<rdar://problem/48702444>

Reviewed by Simon Fraser.

  • UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _interpretKeyEvent:isCharEvent:]): Consume keyboard events instead of interpreting them traditionally if WKKeyboardScrollingAnimator is animating.
  • UIProcess/ios/WKKeyboardScrollingAnimator.h:
  • UIProcess/ios/WKKeyboardScrollingAnimator.mm: (-[WKKeyboardScrollingAnimator beginWithEvent:]): (-[WKKeyboardScrollingAnimator handleKeyEvent:]): (-[WKKeyboardScrollingAnimator stopAnimatedScroll]): (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]): (-[WKKeyboardScrollingAnimator displayLinkFired:]): (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]): Expose the current state of interactive scrolling, and rename the related member.

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

Location:
tags/Safari-608.1.13.2/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-608.1.13.2/Source/WebKit/ChangeLog

    r243399 r243543  
     12019-03-27  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r243454. rdar://problem/48702444
     4
     5    Animated keyboard scrolling is extremely chaotic
     6    https://bugs.webkit.org/show_bug.cgi?id=196164
     7    <rdar://problem/48702444>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    * UIProcess/ios/WKContentViewInteraction.mm:
     12    (-[WKContentView _interpretKeyEvent:isCharEvent:]):
     13    Consume keyboard events instead of interpreting them traditionally
     14    if WKKeyboardScrollingAnimator is animating.
     15   
     16    * UIProcess/ios/WKKeyboardScrollingAnimator.h:
     17    * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
     18    (-[WKKeyboardScrollingAnimator beginWithEvent:]):
     19    (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
     20    (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
     21    (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
     22    (-[WKKeyboardScrollingAnimator displayLinkFired:]):
     23    (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
     24    Expose the current state of interactive scrolling, and rename the related member.
     25   
     26   
     27    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     28
     29    2019-03-25  Tim Horton  <timothy_horton@apple.com>
     30
     31            Animated keyboard scrolling is extremely chaotic
     32            https://bugs.webkit.org/show_bug.cgi?id=196164
     33            <rdar://problem/48702444>
     34
     35            Reviewed by Simon Fraser.
     36
     37            * UIProcess/ios/WKContentViewInteraction.mm:
     38            (-[WKContentView _interpretKeyEvent:isCharEvent:]):
     39            Consume keyboard events instead of interpreting them traditionally
     40            if WKKeyboardScrollingAnimator is animating.
     41
     42            * UIProcess/ios/WKKeyboardScrollingAnimator.h:
     43            * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
     44            (-[WKKeyboardScrollingAnimator beginWithEvent:]):
     45            (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
     46            (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
     47            (-[WKKeyboardScrollingAnimator scrollTriggeringKeyIsPressed]):
     48            (-[WKKeyboardScrollingAnimator displayLinkFired:]):
     49            (-[WKKeyboardScrollViewAnimator scrollTriggeringKeyIsPressed]):
     50            Expose the current state of interactive scrolling, and rename the related member.
     51
    1522019-03-22  Alan Coon  <alancoon@apple.com>
    253
  • tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r243370 r243543  
    44504450        return NO;
    44514451
    4452     if ([_keyboardScrollingAnimator beginWithEvent:event])
     4452    if ([_keyboardScrollingAnimator beginWithEvent:event] || [_keyboardScrollingAnimator scrollTriggeringKeyIsPressed])
    44534453        return YES;
    44544454
  • tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.h

    r242695 r243543  
    6363- (void)handleKeyEvent:(::WebEvent *)event;
    6464
     65- (BOOL)scrollTriggeringKeyIsPressed;
     66
    6567@property (nonatomic, weak) id <WKKeyboardScrollViewAnimatorDelegate> delegate;
    6668
  • tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm

    r242695 r243543  
    100100    Optional<WebKit::KeyboardScroll> _currentScroll;
    101101
    102     BOOL _hasPressedScrollingKey;
     102    BOOL _scrollTriggeringKeyIsPressed;
    103103
    104104    WebCore::FloatSize _velocity; // Points per second.
     
    296296        return NO;
    297297
    298     if (_hasPressedScrollingKey)
     298    if (_scrollTriggeringKeyIsPressed)
    299299        return NO;
    300300
     
    302302        return NO;
    303303
    304     _hasPressedScrollingKey = YES;
     304    _scrollTriggeringKeyIsPressed = YES;
    305305    _currentScroll = scroll;
    306306
     
    329329- (void)handleKeyEvent:(::WebEvent *)event
    330330{
    331     if (!_hasPressedScrollingKey)
     331    if (!_scrollTriggeringKeyIsPressed)
    332332        return;
    333333
     
    335335    if (!scroll || event.type == WebEventKeyUp) {
    336336        [self stopAnimatedScroll];
    337         _hasPressedScrollingKey = NO;
     337        _scrollTriggeringKeyIsPressed = NO;
    338338    }
    339339}
     
    381381    [self stopRepeatTimer];
    382382#endif
     383}
     384
     385- (BOOL)scrollTriggeringKeyIsPressed
     386{
     387    return _scrollTriggeringKeyIsPressed;
    383388}
    384389
     
    459464    // If we've effectively stopped scrolling, and no key is pressed,
    460465    // shut down the display link.
    461     if (!_hasPressedScrollingKey && _velocity.diagonalLengthSquared() < 1) {
     466    if (!_scrollTriggeringKeyIsPressed && _velocity.diagonalLengthSquared() < 1) {
    462467        [_scrollable didFinishScrolling];
    463468        [self stopDisplayLink];
     
    563568{
    564569    return [_animator handleKeyEvent:event];
     570}
     571
     572- (BOOL)scrollTriggeringKeyIsPressed
     573{
     574    return [_animator scrollTriggeringKeyIsPressed];
    565575}
    566576
Note: See TracChangeset for help on using the changeset viewer.