WebKit Bugzilla
Attachment 358656 Details for
Bug 192897
: [iOS] Interpret text key commands on keydown and app key commands on keypress
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
To Land
bug-192897-20190108170016.patch (text/plain), 8.16 KB, created by
Daniel Bates
on 2019-01-08 17:00:17 PST
(
hide
)
Description:
To Land
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-01-08 17:00:17 PST
Size:
8.16 KB
patch
obsolete
>Subversion Revision: 239685 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a4006e282b90675e2f54d49d09d8ab288aadbe50..3d89462e74407c4c47d2d6cf8fdd8065d29c6cc5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-01-08 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Interpret text key commands on keydown and app key commands on keypress >+ https://bugs.webkit.org/show_bug.cgi?id=192897 >+ <rdar://problem/46857378> >+ >+ Reviewed by Brent Fulgham. >+ >+ Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent >+ is false) and keypress (isCharEvent is true), respectively. >+ >+ * Platform/spi/ios/UIKitSPI.h: Add more SPI. >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _interpretKeyEvent:isCharEvent:]): >+ > 2019-01-04 Daniel Bates <dabates@apple.com> > > [iOS] WebKit should handle shift state changes when using the software keyboard >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index 611c2752b39b9df45f34db19b05e60d7f8aa2ceb..df1e1acc622851736c6e737ee90facea81a25845 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,19 @@ >+2018-01-08 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Interpret text key commands on keydown and app key commands on keypress >+ https://bugs.webkit.org/show_bug.cgi?id=192897 >+ <rdar://problem/46857378> >+ >+ Reviewed by Brent Fulgham. >+ >+ Add stubs for SPI. >+ >+ * DefaultDelegates/WebDefaultUIKitDelegate.m: >+ (-[WebDefaultUIKitDelegate handleKeyTextCommandForCurrentEvent]): Added. >+ (-[WebDefaultUIKitDelegate handleKeyAppCommandForCurrentEvent]): Added. >+ (-[WebDefaultUIKitDelegate handleKeyCommandForCurrentEvent]): Deleted. >+ * WebView/WebUIKitDelegate.h: >+ > 2019-01-04 Simon Fraser <simon.fraser@apple.com> > > Factor legacy WK1 code for fixed and scrolling layers into their own helper class >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index f3933e0e47cb6861e96cd62d5db6aeed572d1317..4275678eded8266a2e840377354287e5c39c2f71 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-01-08 Daniel Bates <dabates@apple.com> >+ >+ [iOS] Interpret text key commands on keydown and app key commands on keypress >+ https://bugs.webkit.org/show_bug.cgi?id=192897 >+ <rdar://problem/46857378> >+ >+ Reviewed by Brent Fulgham. >+ >+ Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent >+ is false) and keypress (isCharEvent is true), respectively. >+ >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView _handleEditingKeyEvent:]): >+ > 2019-01-04 Alex Christensen <achristensen@webkit.org> > > Progress towards fixing Mac CMake build >diff --git a/Source/WebKit/Platform/spi/ios/UIKitSPI.h b/Source/WebKit/Platform/spi/ios/UIKitSPI.h >index 2e21e71665930671cca0e679e34a0ac5523d9f96..7a8e870b9524e95998ce1ed1de8cdb310d3a7b94 100644 >--- a/Source/WebKit/Platform/spi/ios/UIKitSPI.h >+++ b/Source/WebKit/Platform/spi/ios/UIKitSPI.h >@@ -1075,6 +1075,8 @@ typedef NSInteger UICompositingMode; > @interface UIKeyboardImpl (IPI) > - (void)setInitialDirection; > - (void)prepareKeyboardInputModeFromPreferences:(UIKeyboardInputMode *)lastUsedMode; >+- (BOOL)handleKeyTextCommandForCurrentEvent; >+- (BOOL)handleKeyAppCommandForCurrentEvent; > @property (nonatomic, readonly) UIKeyboardInputMode *currentInputModeInPreference; > @end > >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 63f21265a0a32bd66a6f42f2d9363eeb17a069d6..fd5def6b06bb6d4fe217c7185185addf7424daa5 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -136,14 +136,6 @@ @end > > #endif > >-#if PLATFORM(IOS_FAMILY) >- >-@interface UIKeyboardImpl (Staging) >-- (BOOL)handleKeyCommandForCurrentEvent; >-@end >- >-#endif >- > namespace WebKit { > using namespace WebCore; > using namespace WebKit; >@@ -4044,7 +4036,9 @@ - (BOOL)_interpretKeyEvent:(::WebEvent *)event isCharEvent:(BOOL)isCharEvent > UIKeyboardImpl *keyboard = [UIKeyboardImpl sharedInstance]; > > #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 >- if (event.type == WebEventKeyDown && [keyboard respondsToSelector:@selector(handleKeyCommandForCurrentEvent)] && [keyboard handleKeyCommandForCurrentEvent]) >+ if (!isCharEvent && [keyboard respondsToSelector:@selector(handleKeyTextCommandForCurrentEvent)] && [keyboard handleKeyTextCommandForCurrentEvent]) >+ return YES; >+ if (isCharEvent && [keyboard respondsToSelector:@selector(handleKeyAppCommandForCurrentEvent)] && [keyboard handleKeyAppCommandForCurrentEvent]) > return YES; > #endif > >diff --git a/Source/WebKitLegacy/ios/DefaultDelegates/WebDefaultUIKitDelegate.m b/Source/WebKitLegacy/ios/DefaultDelegates/WebDefaultUIKitDelegate.m >index aaee826c3339110583a1da60024f34e217233f9f..f2b1fa6c5125e06c569fa80de73982deb4ef697d 100644 >--- a/Source/WebKitLegacy/ios/DefaultDelegates/WebDefaultUIKitDelegate.m >+++ b/Source/WebKitLegacy/ios/DefaultDelegates/WebDefaultUIKitDelegate.m >@@ -162,7 +162,12 @@ - (void)webView:(WebView *)aWebView didReceiveMessage:(NSDictionary *)aMessage > { > } > >-- (BOOL)handleKeyCommandForCurrentEvent >+- (BOOL)handleKeyTextCommandForCurrentEvent >+{ >+ return NO; >+} >+ >+- (BOOL)handleKeyAppCommandForCurrentEvent > { > return NO; > } >diff --git a/Source/WebKitLegacy/ios/WebView/WebUIKitDelegate.h b/Source/WebKitLegacy/ios/WebView/WebUIKitDelegate.h >index b85547b8fe6e2362c306df33f7c46eb51f8a9dd8..989745637da3c14d78b972ca45560c94b300976e 100644 >--- a/Source/WebKitLegacy/ios/WebView/WebUIKitDelegate.h >+++ b/Source/WebKitLegacy/ios/WebView/WebUIKitDelegate.h >@@ -90,7 +90,8 @@ typedef NS_ENUM(NSInteger, WebMediaCaptureType) { > - (void)webView:(WebView *)webView didHideFullScreenForPlugInView:(id)plugInView; > - (void)webView:(WebView *)aWebView didReceiveMessage:(NSDictionary *)aMessage; > - (void)addInputString:(NSString *)str withFlags:(NSUInteger)flags; >-- (BOOL)handleKeyCommandForCurrentEvent; >+- (BOOL)handleKeyTextCommandForCurrentEvent; >+- (BOOL)handleKeyAppCommandForCurrentEvent; > // FIXME: remove deleteFromInput when UIKit implements deleteFromInputWithFlags. > - (void)deleteFromInput; > - (void)deleteFromInputWithFlags:(NSUInteger)flags; >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index ff740ee90efffb1f742832ea2a0d78ae88d3b856..3e003180994d788dba82c253e37595ed11f1cb13 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -6092,8 +6092,12 @@ - (BOOL)_handleEditingKeyEvent:(KeyboardEvent *)wcEvent > if (!webView.isEditable && event.isTabKey) > return NO; > >+ bool isCharEvent = platformEvent->type() == PlatformKeyboardEvent::Char; >+ > #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 >- if (event.type == WebEventKeyDown && [webView._UIKitDelegateForwarder handleKeyCommandForCurrentEvent]) >+ if (!isCharEvent && [webView._UIKitDelegateForwarder handleKeyTextCommandForCurrentEvent]) >+ return YES; >+ if (isCharEvent && [webView._UIKitDelegateForwarder handleKeyAppCommandForCurrentEvent]) > return YES; > #endif > >@@ -6107,14 +6111,14 @@ - (BOOL)_handleEditingKeyEvent:(KeyboardEvent *)wcEvent > return YES; > case kWebEnterKey: > case kWebReturnKey: >- if (platformEvent->type() == PlatformKeyboardEvent::Char) { >+ if (isCharEvent) { > // Map \r from HW keyboard to \n to match the behavior of the soft keyboard. > [[webView _UIKitDelegateForwarder] addInputString:@"\n" withFlags:0]; > return YES; > } > break; > default: >- if (platformEvent->type() == PlatformKeyboardEvent::Char) { >+ if (isCharEvent) { > [[webView _UIKitDelegateForwarder] addInputString:event.characters withFlags:event.keyboardFlags]; > return YES; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192897
:
357755
|
357756
| 358656