Changeset 241734 in webkit
- Timestamp:
- Feb 18, 2019, 1:16:19 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt (modified) (1 diff)
-
LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html (modified) (3 diffs)
-
LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element.html (modified) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/PAL/ChangeLog (modified) (1 diff)
-
Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h (modified) (2 diffs)
-
Source/WebCore/platform/ios/KeyEventIOS.mm (modified) (7 diffs)
-
Source/WebCore/platform/ios/WebEvent.mm (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (12 diffs)
-
Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm (modified) (4 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/HIDEventGenerator.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r241729 r241734 1 2019-02-18 Daniel Bates <dabates@apple.com> 2 3 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element 4 https://bugs.webkit.org/show_bug.cgi?id=192824 5 <rdar://problem/47100332> 6 7 Reviewed by Wenson Hsieh. 8 9 Update tests and expected results. As it turns out fixing the bug in WebKitTestRunner/ios/HIDEventGenerator.mm 10 so that we now dispatch key events for F17 thru F24 exposed a bug in UIKit. See <rdar://problem/47128940>. 11 This same bug is also responsible for a lack of key events when the Insert key is pressed. 12 13 Added sub-test for Tab key to keypress-keys-in-non-editable-element.html. Changed expected result in test 14 keypress-keys-in-non-editable-element.html for the forward delete key to expect failure. We expect that pressing 15 the forward delete key will not dispatch a keypress to match the behavior on Mac. This will be addressed by a 16 UIKit fix. 17 18 * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt: 19 * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html: 20 * fast/events/ios/keypress-keys-in-non-editable-element-expected.txt: 21 * fast/events/ios/keypress-keys-in-non-editable-element.html: 22 1 23 2019-02-18 Eric Carlson <eric.carlson@apple.com> 2 24 -
trunk/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt
r240983 r241734 1 This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: ↑, ↓, ←, →, Delete, End, Enter, Escape, Home, Insert, left Alt, left ⌘ Command, left Ctrl, left ⇧ Shift, Page Down, Page Up, Return, right Alt, right ⌘ Command, right Ctrl, right ⇧ Shift, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24.1 This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: Tab, ↑, ↓, ←, →, Delete, End, Enter, Escape, Home, left Alt, left ⌘ Command, left Ctrl, left ⇧ Shift, Page Down, Page Up, Return, right Alt, right ⌘ Command, right Ctrl, right ⇧ Shift, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16. 2 2 3 type: keydown, key: Tab, code: Tab, keyIdentifier: U+0009, keyCode: 9, charCode: 0, keyCode: 9, which: 9 4 type: keyup, key: Dead, code: Tab, keyIdentifier: Unidentified, keyCode: 9, charCode: 0, keyCode: 9, which: 9 3 5 type: keydown, key: ArrowUp, code: ArrowUp, keyIdentifier: Up, keyCode: 38, charCode: 0, keyCode: 38, which: 38 4 6 type: keyup, key: ArrowUp, code: ArrowUp, keyIdentifier: Up, keyCode: 38, charCode: 0, keyCode: 38, which: 38 -
trunk/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html
r240983 r241734 13 13 </head> 14 14 <body onkeydown="handleKeyDown(event)" onkeyup="handleKeyUp(event)"> 15 <p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: <kbd> ↑</kbd>, <kbd>↓</kbd>, <kbd>←</kbd>, <kbd>→</kbd>, <kbd>Delete</kbd>, <kbd>End</kbd>, <kbd>Enter</kbd>, <kbd>Escape</kbd>, <kbd>Home</kbd>, <kbd>Insert</kbd>, left <kbd>Alt</kbd>, left <kbd>⌘ Command</kbd>, left <kbd>Ctrl</kbd>, left <kbd>⇧ Shift</kbd>, <kbd>Page Down</kbd>, <kbd>Page Up</kbd>, <kbd>Return</kbd>, right <kbd>Alt</kbd>, right <kbd>⌘ Command</kbd>, right <kbd>Ctrl</kbd>, right <kbd>⇧ Shift</kbd>, <kbd>F1</kbd>, <kbd>F2</kbd>, <kbd>F3</kbd>, <kbd>F4</kbd>, <kbd>F5</kbd>, <kbd>F6</kbd>, <kbd>F7</kbd>, <kbd>F8</kbd>, <kbd>F9</kbd>, <kbd>F10</kbd>, <kbd>F11</kbd>, <kbd>F12</kbd>, <kbd>F13</kbd>, <kbd>F14</kbd>, <kbd>F15</kbd>, <kbd>F16</kbd>, <kbd>F17</kbd>, <kbd>F18</kbd>, <kbd>F19</kbd>, <kbd>F20</kbd>, <kbd>F21</kbd>, <kbd>F22</kbd>, <kbd>F23</kbd>, <kbd>F24</kbd>.15 <p>This tests that DOM keydown and keyup events are dispatched to a non-editable <body> on iOS when pressing special keys on a hardware keyboard. To run this test manually, verify that two messages are emitted when you press the following keys: <kbd>Tab</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd>, <kbd>←</kbd>, <kbd>→</kbd>, <kbd>Delete</kbd>, <kbd>End</kbd>, <kbd>Enter</kbd>, <kbd>Escape</kbd>, <kbd>Home</kbd><!-- FIXME: Add <kbd>Insert</kbd> once <rdar://problem/47128940> is fixed. -->, left <kbd>Alt</kbd>, left <kbd>⌘ Command</kbd>, left <kbd>Ctrl</kbd>, left <kbd>⇧ Shift</kbd>, <kbd>Page Down</kbd>, <kbd>Page Up</kbd>, <kbd>Return</kbd>, right <kbd>Alt</kbd>, right <kbd>⌘ Command</kbd>, right <kbd>Ctrl</kbd>, right <kbd>⇧ Shift</kbd>, <kbd>F1</kbd>, <kbd>F2</kbd>, <kbd>F3</kbd>, <kbd>F4</kbd>, <kbd>F5</kbd>, <kbd>F6</kbd>, <kbd>F7</kbd>, <kbd>F8</kbd>, <kbd>F9</kbd>, <kbd>F10</kbd>, <kbd>F11</kbd>, <kbd>F12</kbd>, <kbd>F13</kbd>, <kbd>F14</kbd>, <kbd>F15</kbd>, <kbd>F16</kbd><!-- FIXME: Add <kbd>F17</kbd>, <kbd>F18</kbd>, <kbd>F19</kbd>, <kbd>F20</kbd>, <kbd>F21</kbd>, <kbd>F22</kbd>, <kbd>F23</kbd>, <kbd>F24</kbd> once <rdar://problem/47128940> is fixed.-->. 16 16 </p> 17 17 <pre id="console"></pre> 18 18 <script> 19 19 var remainingKeysToPress = [ 20 "\t", 20 21 "upArrow", 21 22 "downArrow", … … 27 28 "escape", 28 29 "home", 29 "insert",30 // FIXME: Add "insert" once <rdar://problem/47128940> is fixed. 30 31 "leftAlt", 31 32 "leftCommand", … … 41 42 ]; 42 43 43 for (let i = 1; i <= 24; ++i) 44 // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed. 45 for (let i = 1; i <= 16; ++i) 44 46 remainingKeysToPress.push("F" + i); 45 47 -
trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element-expected.txt
r240983 r241734 55 55 PASS escape did dispatch a keypress event. 56 56 PASS return did dispatch a keypress event. 57 PASS forwardDelete did dispatch a keypress event.57 FAIL forwardDelete should not have dispatched a keypress event. It did dispatch one. 58 58 PASS upArrow did not dispatch a keypress event. 59 59 PASS downArrow did not dispatch a keypress event. … … 90 90 PASS F15 did not dispatch a keypress event. 91 91 PASS F16 did not dispatch a keypress event. 92 PASS F17 did not dispatch a keypress event.93 PASS F18 did not dispatch a keypress event.94 PASS F19 did not dispatch a keypress event.95 PASS F20 did not dispatch a keypress event.96 PASS F21 did not dispatch a keypress event.97 PASS F22 did not dispatch a keypress event.98 PASS F23 did not dispatch a keypress event.99 PASS F24 did not dispatch a keypress event.100 92 PASS successfullyParsed is true 101 93 -
trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element.html
r240983 r241734 42 42 tests.push(new TestKeyPressDispatchedFor("return")); 43 43 44 // The forward delete key is mapped to the delete key on iOS and dispatches a keypress event.45 // On Mac it is treated as its own key and does not dispatch a keypress event.46 tests.push(new TestKeyPressDispatchedFor("forwardDelete"));47 48 44 // Special keys: KeyPress should not be dispatched. 45 tests.push(new TestKeyPressNotDispatchedFor("forwardDelete")); 49 46 tests.push(new TestKeyPressNotDispatchedFor("upArrow")); 50 47 tests.push(new TestKeyPressNotDispatchedFor("downArrow")); … … 54 51 tests.push(new TestKeyPressNotDispatchedFor("end")); 55 52 tests.push(new TestKeyPressNotDispatchedFor("home")); 56 tests.push(new TestKeyPressNotDispatchedFor("insert")); 53 // FIXME: Test that keypress is not dispatched for "insert" once <rdar://problem/47128940> is fixed. 57 54 tests.push(new TestKeyPressNotDispatchedFor("leftAlt")); 58 55 tests.push(new TestKeyPressNotDispatchedFor("leftCommand")); … … 65 62 tests.push(new TestKeyPressNotDispatchedFor("rightControl")); 66 63 tests.push(new TestKeyPressNotDispatchedFor("rightShift")); 67 for (let i = 1; i <= 24; ++i) 64 // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed. 65 for (let i = 1; i <= 16; ++i) 68 66 tests.push(new TestKeyPressNotDispatchedFor("F" + i)); 69 67 -
trunk/Source/WebCore/ChangeLog
r241729 r241734 1 2019-02-18 Daniel Bates <dabates@apple.com> 2 3 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element 4 https://bugs.webkit.org/show_bug.cgi?id=192824 5 <rdar://problem/47100332> 6 7 Reviewed by Wenson Hsieh. 8 9 When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes 10 now that hardware key events to non-editable elements use the same code path as for editable elements. 11 12 * platform/ios/KeyEventIOS.mm: 13 (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with 14 !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code. 15 (WebCore::isFunctionKey): Ditto. 16 * platform/ios/WebEvent.mm: 17 (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with 18 USE(UIKIT_KEYBOARD_ADDITIONS) enabled. 19 1 20 2019-02-18 Eric Carlson <eric.carlson@apple.com> 2 21 -
trunk/Source/WebCore/PAL/ChangeLog
r241654 r241734 1 2019-02-18 Daniel Bates <dabates@apple.com> 2 3 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element 4 https://bugs.webkit.org/show_bug.cgi?id=192824 5 <rdar://problem/47100332> 6 7 Reviewed by Wenson Hsieh. 8 9 Expose more enumerators. 10 11 * pal/spi/cocoa/IOKitSPI.h: 12 1 13 2019-02-17 David Kilzer <ddkilzer@apple.com> 2 14 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h
r240983 r241734 186 186 kHIDUsage_KeyboardCapsLock = 0x39, 187 187 kHIDUsage_KeyboardF1 = 0x3A, 188 kHIDUsage_KeyboardF12 = 0x45, 188 189 kHIDUsage_KeyboardPrintScreen = 0x46, 189 190 kHIDUsage_KeyboardInsert = 0x49, … … 199 200 kHIDUsage_KeypadNumLock = 0x53, 200 201 kHIDUsage_KeyboardF13 = 0x68, 202 kHIDUsage_KeyboardF24 = 0x73, 201 203 kHIDUsage_KeyboardMenu = 0x76, 202 204 kHIDUsage_KeyboardLeftControl = 0xE0, -
trunk/Source/WebCore/platform/ios/KeyEventIOS.mm
r241044 r241734 198 198 } 199 199 200 // This function is only used to map software keyboard events because they lack a key code. 201 // When !USE(UIKIT_KEYBOARD_ADDITIONS), this function is also used to map hardware keyboard 202 // keyup events because they lack a key code. 200 203 int windowsKeyCodeForCharCode(unichar charCode) 201 204 { … … 204 207 case 9: return VK_TAB; 205 208 case 0xD: case 3: return VK_RETURN; 206 case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape.207 209 case ' ': return VK_SPACE; 208 210 … … 244 246 case 'z': case 'Z': return VK_Z; 245 247 248 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 249 case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape. 250 246 251 // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys. 247 252 case NSUpArrowFunctionKey: return VK_UP; … … 251 256 case NSPageUpFunctionKey: return VK_PRIOR; 252 257 case NSPageDownFunctionKey: return VK_NEXT; 258 #endif 253 259 254 260 // This is for U.S. keyboard mapping, and doesn't necessarily make sense for different keyboard layouts. … … 272 278 { 273 279 switch (charCode) { 280 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 274 281 case 1: // Home 275 282 case 4: // End … … 277 284 case 0x7F: // Forward Delete 278 285 case 0x10: // Function key (e.g. F1, F2, ...) 286 #endif 279 287 280 288 // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys. … … 286 294 case NSPageDownFunctionKey: 287 295 case NSClearLineFunctionKey: // Num Lock / Clear 296 #if USE(UIKIT_KEYBOARD_ADDITIONS) 297 case NSDeleteFunctionKey: // Forward delete 298 case NSEndFunctionKey: 299 case NSInsertFunctionKey: 300 case NSHomeFunctionKey: 301 #endif 288 302 return true; 289 303 } 304 #if USE(UIKIT_KEYBOARD_ADDITIONS) 305 if (charCode >= NSF1FunctionKey && charCode <= NSF24FunctionKey) 306 return true; 307 #endif 290 308 return false; 291 309 } -
trunk/Source/WebCore/platform/ios/WebEvent.mm
r241282 r241734 150 150 case kHIDUsage_KeypadNumLock: // Num Lock / Clear 151 151 return makeNSStringWithCharacter(NSClearLineFunctionKey); 152 } 152 #if USE(UIKIT_KEYBOARD_ADDITIONS) 153 case kHIDUsage_KeyboardDeleteForward: 154 return makeNSStringWithCharacter(NSDeleteFunctionKey); 155 case kHIDUsage_KeyboardEnd: 156 return makeNSStringWithCharacter(NSEndFunctionKey); 157 case kHIDUsage_KeyboardInsert: 158 return makeNSStringWithCharacter(NSInsertFunctionKey); 159 case kHIDUsage_KeyboardHome: 160 return makeNSStringWithCharacter(NSHomeFunctionKey); 161 #endif 162 } 163 #if USE(UIKIT_KEYBOARD_ADDITIONS) 164 if (keyCode >= kHIDUsage_KeyboardF1 && keyCode <= kHIDUsage_KeyboardF12) 165 return makeNSStringWithCharacter(NSF1FunctionKey + (keyCode - kHIDUsage_KeyboardF1)); 166 if (keyCode >= kHIDUsage_KeyboardF13 && keyCode <= kHIDUsage_KeyboardF24) 167 return makeNSStringWithCharacter(NSF13FunctionKey + (keyCode - kHIDUsage_KeyboardF13)); 168 #endif 153 169 return characters; 154 170 } -
trunk/Source/WebKit/ChangeLog
r241731 r241734 1 2019-02-18 Daniel Bates <dabates@apple.com> 2 3 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element 4 https://bugs.webkit.org/show_bug.cgi?id=192824 5 <rdar://problem/47100332> 6 7 Reviewed by Wenson Hsieh. 8 9 Use the same code path for key events to editable elements and non-editable elements. 10 11 Currently we have different code paths for hardware key events depending on whether the active element 12 is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key 13 presses this differentiation was a necessary workaround for UIKit's event processing precedence of 14 interpreting key events for system text editing commands and app commands before dispatching unhandled 15 key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a 16 WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that 17 is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have 18 empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state 19 that is necessary to manufacture the correct WebEvent corresponding to a UIEvent. 20 21 As a side benefit of this change, with the exception of modifier flag changes, both hardware and software 22 key events use the same code path. 23 24 * UIProcess/ios/WKContentViewInteraction.h: 25 * UIProcess/ios/WKContentViewInteraction.mm: 26 (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder 27 (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI 28 when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the 29 keyboard UI was disabled as a side effect of not becoming first responder when there was no focused 30 element (by returning NO in -_requiresKeyboardWhenFirstResponder). 31 (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS) 32 so that we always accept key events. Instead of selectively replying to create a keyboard as a means of 33 hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the 34 automatic keyboard UI. 35 (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): If we are not in an editable 36 element then we cannot perform the replacement. This logic was necessary now that we always require a 37 keyboard. 38 (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): If we are not in an editable 39 element then return an autocorrection object that indicates that we could not compute this data. This 40 logic was necessary now that we always require a keyboard. 41 (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed 42 now that we require a keyboard when first responder even if the focused element is non-editable. 43 (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit 44 as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit 45 its chance to interpret the UIEvent, we intercepted, for app key commands. 46 (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls 47 (e.g. a <select> popover menu). Currently this happens either by -_requiresKeyboardWhenFirstResponder 48 responding NO when switching to another field or pressing Tab or Shift + Tab key command, which we will 49 no longer use when building with USE(UIKIT_KEYBOARD_ADDITIONS) once I land <https://bugs.webkit.org/show_bug.cgi?id=193048>. 50 * UIProcess/ios/forms/WKFormSelectPopover.mm: 51 (-[WKSelectPopover initWithView:hasGroups:]): Do not assign ourself as the keyboard delegate. Otherwise, 52 type ahead and tab cycling will not work. Currently type ahead and tab cycling work by using the non- 53 editable code path via -_handleKeyUIEvent. Now that we no longer differentiate between key events for 54 editable and non-editable elements we need to ensure that the WKContentView is the keyboard delegate 55 when the popover is presented. 56 1 57 2019-02-18 Jiewen Tan <jiewen_tan@apple.com> 2 58 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r241614 r241734 262 262 WebKit::FocusedElementInformation _focusedElementInformation; 263 263 RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral; 264 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 264 265 RetainPtr<UIEvent> _uiEventBeingResent; 266 #endif 265 267 BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler; 266 268 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r241614 r241734 60 60 #import "WKTimePickerViewController.h" 61 61 #import "WKUIDelegatePrivate.h" 62 #import "WKWebEvent.h"63 62 #import "WKWebViewConfiguration.h" 64 63 #import "WKWebViewConfigurationPrivate.h" … … 123 122 #if ENABLE(INPUT_TYPE_COLOR) 124 123 #import "WKFormColorControl.h" 124 #endif 125 126 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 127 #import "WKWebEvent.h" 125 128 #endif 126 129 … … 1498 1501 } 1499 1502 1500 - (BOOL) _requiresKeyboardWhenFirstResponder1501 { 1502 // FIXME: We should add the logic to handle keyboard visibility during focus redirects.1503 - (BOOL)shouldShowAutomaticKeyboardUI 1504 { 1505 // FIXME: Make this function knowledgeable about the HTML attribute inputmode. 1503 1506 switch (_focusedElementInformation.elementType) { 1504 1507 case WebKit::InputType::None: … … 1518 1521 } 1519 1522 return NO; 1523 } 1524 1525 #if USE(UIKIT_KEYBOARD_ADDITIONS) 1526 - (BOOL)_disableAutomaticKeyboardUI 1527 { 1528 // Always enable automatic keyboard UI if we are not the first responder to avoid 1529 // interfering with other focused views (e.g. Find-in-page). 1530 return [self isFirstResponder] && ![self shouldShowAutomaticKeyboardUI]; 1531 } 1532 #endif 1533 1534 - (BOOL)_requiresKeyboardWhenFirstResponder 1535 { 1536 #if USE(UIKIT_KEYBOARD_ADDITIONS) 1537 return YES; 1538 #else 1539 // FIXME: We should add the logic to handle keyboard visibility during focus redirects. 1540 return [self shouldShowAutomaticKeyboardUI]; 1541 #endif 1520 1542 } 1521 1543 … … 3458 3480 - (void)applyAutocorrection:(NSString *)correction toString:(NSString *)input withCompletionHandler:(void (^)(UIWKAutocorrectionRects *rectsForCorrection))completionHandler 3459 3481 { 3482 #if USE(UIKIT_KEYBOARD_ADDITIONS) 3483 if ([self _disableAutomaticKeyboardUI]) { 3484 if (completionHandler) 3485 completionHandler(nil); 3486 return; 3487 } 3488 #endif 3489 3460 3490 // FIXME: Remove the synchronous call when <rdar://problem/16207002> is fixed. 3461 3491 const bool useSyncRequest = true; … … 3477 3507 if (!completionHandler) 3478 3508 return; 3509 3510 #if USE(UIKIT_KEYBOARD_ADDITIONS) 3511 if ([self _disableAutomaticKeyboardUI]) { 3512 completionHandler([WKAutocorrectionContext autocorrectionContextWithContext:(WebKit::WebAutocorrectionContext { })]); 3513 return; 3514 } 3515 #endif 3479 3516 3480 3517 // FIXME: Remove the synchronous call when <rdar://problem/16207002> is fixed. … … 3984 4021 _traits = adoptNS([[UITextInputTraits alloc] init]); 3985 4022 4023 #if USE(UIKIT_KEYBOARD_ADDITIONS) 4024 // Do not change traits when dismissing the keyboard. 4025 if (_isBlurringFocusedNode) 4026 return _traits.get(); 4027 #endif 4028 3986 4029 [_traits setSecureTextEntry:_focusedElementInformation.elementType == WebKit::InputType::Password || [_formInputSession forceSecureTextEntry]]; 3987 4030 [_traits setShortcutConversionType:_focusedElementInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault]; … … 4141 4184 } 4142 4185 4186 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 4143 4187 - (void)_handleKeyUIEvent:(::UIEvent *)event 4144 4188 { … … 4165 4209 [self handleKeyWebEvent:webEvent.get()]; 4166 4210 } 4211 #endif 4167 4212 4168 4213 - (void)handleKeyWebEvent:(::WebEvent *)theEvent … … 4194 4239 } 4195 4240 4241 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 4196 4242 // If we aren't interacting with editable content, we still need to call [super _handleKeyUIEvent:] 4197 4243 // so that keyboard repeat will work correctly. If we are interacting with editable content, … … 4212 4258 [super _handleKeyUIEvent:_uiEventBeingResent.get()]; 4213 4259 _uiEventBeingResent = nil; 4260 #endif 4214 4261 } 4215 4262 … … 4826 4873 #if HAVE(PENCILKIT) 4827 4874 [_drawingCoordinator uninstallInkPicker]; 4875 #endif 4876 4877 #if USE(UIKIT_KEYBOARD_ADDITIONS) 4878 [self _endEditing]; 4828 4879 #endif 4829 4880 -
trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
r240983 r241734 79 79 @class WKSelectPopover; 80 80 81 #if USE(UIKIT_KEYBOARD_ADDITIONS) 82 @interface WKSelectTableViewController : UITableViewController 83 #else 81 84 @interface WKSelectTableViewController : UITableViewController <UIKeyInput> 85 #endif 82 86 { 83 87 NSUInteger _singleSelectionIndex; … … 360 364 } 361 365 366 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 362 367 #pragma mark UIKeyInput delegate methods 363 368 … … 374 379 { 375 380 } 381 382 #endif 376 383 377 384 @end … … 411 418 412 419 [navController release]; 413 420 421 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 414 422 [[UIKeyboardImpl sharedInstance] setDelegate:_tableViewController.get()]; 423 #endif 415 424 416 425 return self; -
trunk/Tools/ChangeLog
r241733 r241734 1 2019-02-18 Daniel Bates <dabates@apple.com> 2 3 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element 4 https://bugs.webkit.org/show_bug.cgi?id=192824 5 <rdar://problem/47100332> 6 7 Reviewed by Wenson Hsieh. 8 9 Fix a bug where the wrong usage code was used for F13 thru F24. 10 11 * WebKitTestRunner/ios/HIDEventGenerator.mm: 12 (keyCodeForDOMFunctionKey): 13 1 14 2019-02-18 Tadeu Zagallo <tzagallo@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm
r240983 r241734 835 835 for (int i = 13; i <= 24; ++i) { 836 836 if ([key isEqualToString:[NSString stringWithFormat:@"F%d", i]]) 837 return kHIDUsage_KeyboardF13 + i - 1 ;837 return kHIDUsage_KeyboardF13 + i - 13; 838 838 } 839 839 return WTF::nullopt;
Note:
See TracChangeset
for help on using the changeset viewer.