[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2018 18:58:52 +0000 (18:58 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2018 18:58:52 +0000 (18:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192633

Reviewed by Wenson Hsieh.

Source/WebCore:

UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
for binary compatibility.

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

Source/WebKit:

Update code to use the modern initializer.

* UIProcess/ios/WKWebEvent.mm:
(-[WKWebEvent initWithEvent:]):

Tools:

Update code to use the modern initializer.

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController keyDown:withModifiers:withLocation:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebEvent.h
Source/WebCore/platform/ios/WebEvent.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKWebEvent.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/EventSendingController.mm

index 59179f6..572af28 100644 (file)
@@ -1,3 +1,18 @@
+2018-12-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
+        https://bugs.webkit.org/show_bug.cgi?id=192633
+
+        Reviewed by Wenson Hsieh.
+
+        UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
+        input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
+        for binary compatibility.
+
+        * platform/ios/WebEvent.h:
+        * platform/ios/WebEvent.mm:
+        (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
+
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
index 224a07e..97518df 100644 (file)
@@ -159,18 +159,6 @@ WEBCORE_EXPORT @interface WebEvent : NSObject {
                         gestureScale:(float)gestureScale
                      gestureRotation:(float)gestureRotation;
 
                         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
-       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
-                         modifiers:(WebEventFlags)modifiers
-                       isRepeating:(BOOL)repeating
-                         withFlags:(WebKeyboardInputFlags)flags
-                           keyCode:(uint16_t)keyCode
-                          isTabKey:(BOOL)tabKey
-                      characterSet:(WebEventCharacterSet)characterSet;
-
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
index a6bd733..8d88f2b 100644 (file)
@@ -157,44 +157,6 @@ static NSString *normalizedStringWithAppKitCompatibilityMapping(NSString *charac
     return characters;
 }
 
     return characters;
 }
 
-// FIXME: to be removed when the adoption of the new initializer is complete.
-- (WebEvent *)initWithKeyEventType:(WebEventType)type
-                         timeStamp:(CFTimeInterval)timeStamp
-                        characters:(NSString *)characters
-       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
-                         modifiers:(WebEventFlags)modifiers
-                       isRepeating:(BOOL)repeating
-                         withFlags:(NSUInteger)flags
-                           keyCode:(uint16_t)keyCode
-                          isTabKey:(BOOL)tabKey
-                      characterSet:(WebEventCharacterSet)characterSet
-{
-    UNUSED_PARAM(characterSet);
-    self = [super init];
-    if (!self)
-        return nil;
-    
-    _type = type;
-    _timestamp = timeStamp;
-    _keyboardFlags = flags;
-    _modifierFlags = modifiers;
-    if (keyCode)
-        _keyCode = windowsKeyCodeForKeyCode(keyCode);
-    else if ([charactersIgnoringModifiers length] == 1) {
-        // This event is likely for a software keyboard-generated event.
-        _keyCode = windowsKeyCodeForCharCodeIOS([charactersIgnoringModifiers characterAtIndex:0]);
-    }
-
-    if (!(_keyboardFlags & WebEventKeyboardInputModifierFlagsChanged)) {
-        _characters = [normalizedStringWithAppKitCompatibilityMapping(characters, keyCode) retain];
-        _charactersIgnoringModifiers = [normalizedStringWithAppKitCompatibilityMapping(charactersIgnoringModifiers, keyCode) retain];
-        _tabKey = tabKey;
-        _keyRepeating = repeating;
-    }
-
-    return self;
-}
-
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
 - (WebEvent *)initWithKeyEventType:(WebEventType)type
                          timeStamp:(CFTimeInterval)timeStamp
                         characters:(NSString *)characters
index 70f0bcc..b5f6b89 100644 (file)
@@ -1,3 +1,15 @@
+2018-12-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
+        https://bugs.webkit.org/show_bug.cgi?id=192633
+
+        Reviewed by Wenson Hsieh.
+
+        Update code to use the modern initializer.
+
+        * UIProcess/ios/WKWebEvent.mm:
+        (-[WKWebEvent initWithEvent:]):
+
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
index 7d81e33..ab59687 100644 (file)
@@ -53,7 +53,7 @@
         event = [[keyEvent _cloneEvent] autorelease]; // UIKit uses a singleton for hardware keyboard events.
     }
 
         event = [[keyEvent _cloneEvent] autorelease]; // UIKit uses a singleton for hardware keyboard events.
     }
 
-    self = [super initWithKeyEventType:(event._isKeyDown ? WebEventKeyDown : WebEventKeyUp) timeStamp:event.timestamp characters:event._modifiedInput charactersIgnoringModifiers:event._unmodifiedInput modifiers:modifierFlags isRepeating:(inputFlags & kUIKeyboardInputRepeat) withFlags:inputFlags keyCode:keyCode isTabKey:[event._modifiedInput isEqualToString:@"\t"] characterSet:WebEventCharacterSetUnicode];
+    self = [super initWithKeyEventType:(event._isKeyDown ? WebEventKeyDown : WebEventKeyUp) timeStamp:event.timestamp characters:event._modifiedInput charactersIgnoringModifiers:event._unmodifiedInput modifiers:modifierFlags isRepeating:(inputFlags & kUIKeyboardInputRepeat) withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:[event._modifiedInput isEqualToString:@"\t"]];
     if (!self)
         return nil;
 
     if (!self)
         return nil;
 
index 5d304d1..e456f27 100644 (file)
@@ -1,3 +1,15 @@
+2018-12-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
+        https://bugs.webkit.org/show_bug.cgi?id=192633
+
+        Reviewed by Wenson Hsieh.
+
+        Update code to use the modern initializer.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController keyDown:withModifiers:withLocation:]):
+
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
 2018-12-17  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r239254.
index b5a93e7..19fefad 100644 (file)
@@ -1134,16 +1134,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
                         isARepeat:NO
                         keyCode:keyCode];
 #else
                         isARepeat:NO
                         keyCode:keyCode];
 #else
-    WebEvent *event = [[WebEvent alloc] initWithKeyEventType:WebEventKeyDown
-                        timeStamp:[self currentEventTime]
-                        characters:eventCharacter
-                        charactersIgnoringModifiers:charactersIgnoringModifiers
-                        modifiers:(WebEventFlags)modifierFlags
-                        isRepeating:NO
-                        withFlags:0
-                        keyCode:[character characterAtIndex:0]
-                        isTabKey:([character characterAtIndex:0] == '\t')
-                        characterSet:WebEventCharacterSetASCII];
+    WebEvent *event = [[WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:[self currentEventTime] characters:eventCharacter charactersIgnoringModifiers:charactersIgnoringModifiers modifiers:(WebEventFlags)modifierFlags isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:[character characterAtIndex:0] isTabKey:([character characterAtIndex:0] == '\t')];
 #endif
 
 #if !PLATFORM(IOS_FAMILY)
 #endif
 
 #if !PLATFORM(IOS_FAMILY)
@@ -1167,16 +1158,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
                         keyCode:keyCode];
 #else
     [event release];
                         keyCode:keyCode];
 #else
     [event release];
-    event = [[WebEvent alloc] initWithKeyEventType:WebEventKeyUp
-                        timeStamp:[self currentEventTime]
-                        characters:eventCharacter
-                        charactersIgnoringModifiers:charactersIgnoringModifiers
-                        modifiers:(WebEventFlags)modifierFlags
-                        isRepeating:NO
-                        withFlags:0
-                        keyCode:[character characterAtIndex:0]
-                        isTabKey:([character characterAtIndex:0] == '\t')
-                        characterSet:WebEventCharacterSetASCII];
+    event = [[WebEvent alloc] initWithKeyEventType:WebEventKeyUp timeStamp:[self currentEventTime] characters:eventCharacter charactersIgnoringModifiers:charactersIgnoringModifiers modifiers:(WebEventFlags)modifierFlags isRepeating:NO withFlags:0 withInputManagerHint:nil keyCode:[character characterAtIndex:0] isTabKey:([character characterAtIndex:0] == '\t')];
 #endif
 
 #if !PLATFORM(IOS_FAMILY)
 #endif
 
 #if !PLATFORM(IOS_FAMILY)