Title: [201199] trunk/Source
Revision
201199
Author
[email protected]
Date
2016-05-19 16:32:13 -0700 (Thu, 19 May 2016)

Log Message

No candidate punctuation when typing punctuation in WK2 text field.
https://bugs.webkit.org/show_bug.cgi?id=157773
rdar://problem/23084603

Reviewed by Sam Weinig.

Source/WebCore:

We need to keep the inputManagerHint as part of the platform key event
information. Adding a new initializer for the task and a property to retrieve
the stored hint.

* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
(-[WebEvent dealloc]):
(-[WebEvent inputManagerHint]):

Source/WebKit2:

We need to adopt the new addInputString:withFlags:withInputManagerHint function
for this to work propertly.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interpretKeyEvent:isCharEvent:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201198 => 201199)


--- trunk/Source/WebCore/ChangeLog	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebCore/ChangeLog	2016-05-19 23:32:13 UTC (rev 201199)
@@ -1,3 +1,22 @@
+2016-05-16  Enrica Casucci  <[email protected]>
+
+        No candidate punctuation when typing punctuation in WK2 text field.
+        https://bugs.webkit.org/show_bug.cgi?id=157773
+        rdar://problem/23084603
+
+        Reviewed by Sam Weinig.
+
+        We need to keep the inputManagerHint as part of the platform key event
+        information. Adding a new initializer for the task and a property to retrieve
+        the stored hint.
+
+        * platform/ios/WebEvent.h:
+        * platform/ios/WebEvent.mm:
+        (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
+        (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
+        (-[WebEvent dealloc]):
+        (-[WebEvent inputManagerHint]):
+
 2016-05-19  Brady Eidson  <[email protected]>
 
         Finishing off: Modern IDB: Website data store management.

Modified: trunk/Source/WebCore/platform/ios/WebEvent.h (201198 => 201199)


--- trunk/Source/WebCore/platform/ios/WebEvent.h	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebCore/platform/ios/WebEvent.h	2016-05-19 23:32:13 UTC (rev 201199)
@@ -87,6 +87,7 @@
     WebEventFlags _modifierFlags;
     BOOL _keyRepeating;
     NSUInteger _keyboardFlags;
+    NSString *_inputManagerHint;
     uint16_t _keyCode;
     BOOL _tabKey;
     
@@ -125,6 +126,7 @@
                         gestureScale:(float)gestureScale
                      gestureRotation:(float)gestureRotation;
 
+// FIXME: this needs to be removed when UIKit adopts the other initializer.
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
@@ -136,6 +138,17 @@
                           isTabKey:(BOOL)tabKey
                       characterSet:(WebEventCharacterSet)characterSet;
 
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                         withFlags:(NSUInteger)flags
+              withInputManagerHint:(NSString *)hint
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey;
+
 @property(nonatomic, readonly) WebEventType type;
 @property(nonatomic, readonly) CFTimeInterval timestamp;
 
@@ -147,6 +160,7 @@
 @property(nonatomic, readonly, retain) NSString *charactersIgnoringModifiers;
 @property(nonatomic, readonly) WebEventFlags modifierFlags;
 @property(nonatomic, readonly, getter = isKeyRepeating) BOOL keyRepeating;
+@property(nonatomic, readonly, retain) NSString *inputManagerHint;
 
 @property(nonatomic, readonly) NSUInteger keyboardFlags;
 @property(nonatomic, readonly) uint16_t keyCode;

Modified: trunk/Source/WebCore/platform/ios/WebEvent.mm (201198 => 201199)


--- trunk/Source/WebCore/platform/ios/WebEvent.mm	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebCore/platform/ios/WebEvent.mm	2016-05-19 23:32:13 UTC (rev 201199)
@@ -121,6 +121,7 @@
     return windowsKeyCodeForCharCode(charCode);
 }
 
+// FIXME: to be removed when the adoption of the new initializer is complete.
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
@@ -163,10 +164,53 @@
     return self;
 }
 
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                         withFlags:(NSUInteger)flags
+              withInputManagerHint:(NSString *)hint
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _type = type;
+    _timestamp = timeStamp;
+    
+    _characters = [characters retain];
+    _charactersIgnoringModifiers = [charactersIgnoringModifiers retain];
+    _modifierFlags = modifiers;
+    _keyRepeating = repeating;
+    _keyboardFlags = flags;
+    _inputManagerHint = [hint retain];
+    _tabKey = tabKey;
+    
+    if (keyCode)
+        _keyCode = windowsKeyCodeForKeyCode(keyCode);
+    
+    // NOTE: this preserves the original semantics which used the
+    // characters string for the keyCode. This should be changed in iOS 4.0 to
+    // allow the client to explicitly specify a keyCode, otherwise default to
+    // mapping the characters string to a keyCode.
+    // e.g. add an 'else' before this 'if'.
+    if ([charactersIgnoringModifiers length] == 1) {
+        unichar ch = [charactersIgnoringModifiers characterAtIndex:0];
+        _keyCode = windowsKeyCodeForCharCodeIOS(ch);
+    }
+    
+    return self;
+}
+
 - (void)dealloc
 {
     [_characters release];
     [_charactersIgnoringModifiers release];
+    [_inputManagerHint release];
 
     [_touchLocations release];
     [_touchIdentifiers release];
@@ -335,6 +379,11 @@
     return [[_charactersIgnoringModifiers retain] autorelease];
 }
 
+- (NSString *)inputManagerHint
+{
+    return [[_inputManagerHint retain] autorelease];
+}
+
 - (WebEventFlags)modifierFlags
 {
     return _modifierFlags;

Modified: trunk/Source/WebKit2/ChangeLog (201198 => 201199)


--- trunk/Source/WebKit2/ChangeLog	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-19 23:32:13 UTC (rev 201199)
@@ -1,3 +1,18 @@
+2016-05-16  Enrica Casucci  <[email protected]>
+
+        No candidate punctuation when typing punctuation in WK2 text field.
+        https://bugs.webkit.org/show_bug.cgi?id=157773
+        rdar://problem/23084603
+
+        Reviewed by Sam Weinig.
+
+        We need to adopt the new addInputString:withFlags:withInputManagerHint function
+        for this to work propertly.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
+
 2016-05-19  Brady Eidson  <[email protected]>
 
         Finishing off: Modern IDB: Website data store management.

Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (201198 => 201199)


--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2016-05-19 23:32:13 UTC (rev 201199)
@@ -223,6 +223,7 @@
 + (UIKeyboardImpl *)sharedInstance;
 + (CGSize)defaultSizeForInterfaceOrientation:(UIInterfaceOrientation)orientation;
 - (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags;
+- (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags withInputManagerHint:(NSString *)hint;
 - (BOOL)autocorrectSpellingEnabled;
 - (void)deleteFromInput;
 - (void)deleteFromInputWithFlags:(NSUInteger)flags;

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (201198 => 201199)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-05-19 22:58:40 UTC (rev 201198)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-05-19 23:32:13 UTC (rev 201199)
@@ -229,6 +229,7 @@
 - (void)didHandleWebKeyEvent;
 - (void)didHandleWebKeyEvent:(WebIOSEvent *)event;
 - (void)deleteFromInputWithFlags:(NSUInteger)flags;
+- (void)addInputString:(NSString *)string withFlags:(NSUInteger)flags withInputManagerHint:(NSString *)hint;
 @end
 
 @interface UIView (UIViewInternalHack)
@@ -3263,7 +3264,10 @@
 
     case kWebSpaceKey:
         if (contentEditable && isCharEvent) {
-            [keyboard addInputString:event.characters withFlags:event.keyboardFlags];
+            if ([keyboard respondsToSelector:@selector(addInputString:withFlags:withInputManagerHint:)])
+                [keyboard addInputString:event.characters withFlags:event.keyboardFlags withInputManagerHint:event.inputManagerHint];
+            else
+                [keyboard addInputString:event.characters withFlags:event.keyboardFlags];
             return YES;
         }
         break;
@@ -3283,7 +3287,10 @@
 
     default:
         if (contentEditable && isCharEvent) {
-            [keyboard addInputString:event.characters withFlags:event.keyboardFlags];
+            if ([keyboard respondsToSelector:@selector(addInputString:withFlags:withInputManagerHint:)])
+                [keyboard addInputString:event.characters withFlags:event.keyboardFlags withInputManagerHint:event.inputManagerHint];
+            else
+                [keyboard addInputString:event.characters withFlags:event.keyboardFlags];
             return YES;
         }
         break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to