Title: [243543] tags/Safari-608.1.13.2/Source/WebKit
Revision
243543
Author
[email protected]
Date
2019-03-27 08:46:26 -0700 (Wed, 27 Mar 2019)

Log 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

Modified Paths

Diff

Modified: tags/Safari-608.1.13.2/Source/WebKit/ChangeLog (243542 => 243543)


--- tags/Safari-608.1.13.2/Source/WebKit/ChangeLog	2019-03-27 15:29:33 UTC (rev 243542)
+++ tags/Safari-608.1.13.2/Source/WebKit/ChangeLog	2019-03-27 15:46:26 UTC (rev 243543)
@@ -1,3 +1,54 @@
+2019-03-27  Alan Coon  <[email protected]>
+
+        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
+
+    2019-03-25  Tim Horton  <[email protected]>
+
+            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.
+
 2019-03-22  Alan Coon  <[email protected]>
 
         Cherry-pick r243392. rdar://problem/49123855

Modified: tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (243542 => 243543)


--- tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-03-27 15:29:33 UTC (rev 243542)
+++ tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-03-27 15:46:26 UTC (rev 243543)
@@ -4449,7 +4449,7 @@
     if (!contentEditable && event.isTabKey)
         return NO;
 
-    if ([_keyboardScrollingAnimator beginWithEvent:event])
+    if ([_keyboardScrollingAnimator beginWithEvent:event] || [_keyboardScrollingAnimator scrollTriggeringKeyIsPressed])
         return YES;
 
     UIKeyboardImpl *keyboard = [UIKeyboardImpl sharedInstance];

Modified: tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.h (243542 => 243543)


--- tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.h	2019-03-27 15:29:33 UTC (rev 243542)
+++ tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.h	2019-03-27 15:46:26 UTC (rev 243543)
@@ -62,6 +62,8 @@
 - (BOOL)beginWithEvent:(::WebEvent *)event;
 - (void)handleKeyEvent:(::WebEvent *)event;
 
+- (BOOL)scrollTriggeringKeyIsPressed;
+
 @property (nonatomic, weak) id <WKKeyboardScrollViewAnimatorDelegate> delegate;
 
 @end

Modified: tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm (243542 => 243543)


--- tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2019-03-27 15:29:33 UTC (rev 243542)
+++ tags/Safari-608.1.13.2/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2019-03-27 15:46:26 UTC (rev 243543)
@@ -99,7 +99,7 @@
 
     Optional<WebKit::KeyboardScroll> _currentScroll;
 
-    BOOL _hasPressedScrollingKey;
+    BOOL _scrollTriggeringKeyIsPressed;
 
     WebCore::FloatSize _velocity; // Points per second.
 
@@ -295,13 +295,13 @@
     if (!scroll)
         return NO;
 
-    if (_hasPressedScrollingKey)
+    if (_scrollTriggeringKeyIsPressed)
         return NO;
 
     if (![_scrollable rubberbandableDirections].at(boxSide(scroll->direction)))
         return NO;
 
-    _hasPressedScrollingKey = YES;
+    _scrollTriggeringKeyIsPressed = YES;
     _currentScroll = scroll;
 
 #if ENABLE(ANIMATED_KEYBOARD_SCROLLING)
@@ -328,13 +328,13 @@
 
 - (void)handleKeyEvent:(::WebEvent *)event
 {
-    if (!_hasPressedScrollingKey)
+    if (!_scrollTriggeringKeyIsPressed)
         return;
 
     auto scroll = [self keyboardScrollForEvent:event];
     if (!scroll || event.type == WebEventKeyUp) {
         [self stopAnimatedScroll];
-        _hasPressedScrollingKey = NO;
+        _scrollTriggeringKeyIsPressed = NO;
     }
 }
 
@@ -382,6 +382,11 @@
 #endif
 }
 
+- (BOOL)scrollTriggeringKeyIsPressed
+{
+    return _scrollTriggeringKeyIsPressed;
+}
+
 - (void)willStartInteractiveScroll
 {
     // If the user touches the screen to start an interactive scroll, stop everything.
@@ -458,7 +463,7 @@
 
     // If we've effectively stopped scrolling, and no key is pressed,
     // shut down the display link.
-    if (!_hasPressedScrollingKey && _velocity.diagonalLengthSquared() < 1) {
+    if (!_scrollTriggeringKeyIsPressed && _velocity.diagonalLengthSquared() < 1) {
         [_scrollable didFinishScrolling];
         [self stopDisplayLink];
         _velocity = { };
@@ -564,6 +569,11 @@
     return [_animator handleKeyEvent:event];
 }
 
+- (BOOL)scrollTriggeringKeyIsPressed
+{
+    return [_animator scrollTriggeringKeyIsPressed];
+}
+
 - (BOOL)isKeyboardScrollable
 {
     if (!_delegateRespondsToIsKeyboardScrollable)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to