WebKit Bugzilla
Attachment 357755 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]
Patch
bug-192897-20181219165127.patch (text/plain), 7.40 KB, created by
Daniel Bates
on 2018-12-19 16:51:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-12-19 16:51:28 PST
Size:
7.40 KB
patch
obsolete
>Subversion Revision: 239378 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2f5c5d8ec17619ad7a7b5310316b6071ab1db994..db8ac3abcae81448ff19815769169296a5470398 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-12-19 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 NOBODY (OOPS!). >+ >+ Adopt SPI to interpret text key commands and app key commands independently on keydown (isCharEvent >+ is false) and keypress (isCharEvent is true), respectively. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _interpretKeyEvent:isCharEvent:]): >+ > 2018-12-18 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 e844f90513c336c24e639fef698bd8381b644ac2..24b6ac73fabdf094b6d4d95a3435a105d8e6c19d 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-19 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 NOBODY (OOPS!). >+ >+ Add stubs for SPI. >+ >+ * DefaultDelegates/WebDefaultUIKitDelegate.m: >+ (-[WebDefaultUIKitDelegate handleKeyTextCommandForCurrentEvent]): Added. >+ (-[WebDefaultUIKitDelegate handleKeyAppCommandForCurrentEvent]): Added. >+ (-[WebDefaultUIKitDelegate handleKeyCommandForCurrentEvent]): Deleted. >+ * WebView/WebUIKitDelegate.h: >+ > 2018-12-17 Zalan Bujtas <zalan@apple.com> > > Unreviewed build fix. >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e24389c31e7c7067ffe45bc6410bb4a5fe419ada..fe1d2d59957c7d1bb1eae4ff9017f9d56e6a691b 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-12-19 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 NOBODY (OOPS!). >+ >+ 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:]): >+ > 2018-12-17 Ryosuke Niwa <rniwa@webkit.org> > > offsetLeft and offsetParent should adjust across shadow boundaries >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 66e8a893258dfbb5fefe6c17d22dcbff6d9ec373..7ac48754f6628119da6cc9b10e14667b654fdc94 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -138,7 +138,8 @@ @end > #if PLATFORM(IOS_FAMILY) > > @interface UIKeyboardImpl (Staging) >-- (BOOL)handleKeyCommandForCurrentEvent; >+- (BOOL)handleKeyTextCommandForCurrentEvent; >+- (BOOL)handleKeyAppCommandForCurrentEvent; > @end > > #endif >@@ -4048,7 +4049,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 9c3c2bb99cc0c6cd3053798ddb6644c9e7db8142..ebb872aaa9dc668467f587c6608183f186dc3444 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