Title: [237011] trunk/Source/WebKit
Revision
237011
Author
[email protected]
Date
2018-10-10 11:43:20 -0700 (Wed, 10 Oct 2018)

Log Message

REGRESSION (r236678): Keyboard scrolling with arrow keys doesn't work on iOS
https://bugs.webkit.org/show_bug.cgi?id=190433
<rdar://problem/45111986>

Reviewed by Simon Fraser.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
(-[WKKeyboardScrollingAnimator beginWithEvent:]): Deleted.
(-[WKKeyboardScrollViewAnimator beginWithEvent:]): Deleted.
r236678 changes the characters in charactersIgnoringModifiers to match AppKit.
We similarly need to update WKKeyboardScrollingAnimator's comparison.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (237010 => 237011)


--- trunk/Source/WebKit/ChangeLog	2018-10-10 18:34:49 UTC (rev 237010)
+++ trunk/Source/WebKit/ChangeLog	2018-10-10 18:43:20 UTC (rev 237011)
@@ -1,3 +1,18 @@
+2018-10-10  Tim Horton  <[email protected]>
+
+        REGRESSION (r236678): Keyboard scrolling with arrow keys doesn't work on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=190433
+        <rdar://problem/45111986>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
+        (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
+        (-[WKKeyboardScrollingAnimator beginWithEvent:]): Deleted.
+        (-[WKKeyboardScrollViewAnimator beginWithEvent:]): Deleted.
+        r236678 changes the characters in charactersIgnoringModifiers to match AppKit.
+        We similarly need to update WKKeyboardScrollingAnimator's comparison.
+
 2018-10-10  Yusuke Suzuki  <[email protected]>
 
         [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr

Modified: trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm (237010 => 237011)


--- trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2018-10-10 18:34:49 UTC (rev 237010)
+++ trunk/Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm	2018-10-10 18:43:20 UTC (rev 237011)
@@ -31,6 +31,7 @@
 #import "UIKitSPI.h"
 #import <QuartzCore/CADisplayLink.h>
 #import <WebCore/FloatPoint.h>
+#import <WebCore/KeyEventCodesIOS.h>
 #import <WebCore/RectEdges.h>
 #import <WebCore/WebEvent.h>
 #import <WebKit/UIKitSPI.h>
@@ -190,21 +191,25 @@
     enum class Key : uint8_t { Other, LeftArrow, RightArrow, UpArrow, DownArrow, PageUp, PageDown, Space };
     
     auto key = ^{
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputLeftArrow])
+        auto firstCharacter = [charactersIgnoringModifiers characterAtIndex:0];
+        switch (firstCharacter) {
+        case NSLeftArrowFunctionKey:
             return Key::LeftArrow;
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputRightArrow])
+        case NSRightArrowFunctionKey:
             return Key::RightArrow;
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputUpArrow])
+        case NSUpArrowFunctionKey:
             return Key::UpArrow;
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputDownArrow])
+        case NSDownArrowFunctionKey:
             return Key::DownArrow;
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputPageDown])
+        case NSPageDownFunctionKey:
             return Key::PageDown;
-        if ([charactersIgnoringModifiers isEqualToString:UIKeyInputPageUp])
+        case NSPageUpFunctionKey:
             return Key::PageUp;
-        if ([charactersIgnoringModifiers characterAtIndex:0] == kWebSpaceKey)
+        case kWebSpaceKey:
             return Key::Space;
-        return Key::Other;
+        default:
+            return Key::Other;
+        };
     }();
     
     if (key == Key::Other)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to