Changeset 240983 in webkit
- Timestamp:
- Feb 5, 2019 10:39:36 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240964 r240983 1 2019-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r240742. 4 5 Causes crashes on iOS simulator. 6 7 Reverted changeset: 8 9 "[iOS] Keyups for non-modifier keys identified as "Dead" when 10 not focused in a content-editable element" 11 https://bugs.webkit.org/show_bug.cgi?id=192824 12 https://trac.webkit.org/changeset/240742 13 1 14 2019-02-04 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/LayoutTests/fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt
r240742 r240983 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.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. 2 2 3 type: keydown, key: Tab, code: Tab, keyIdentifier: U+0009, keyCode: 9, charCode: 0, keyCode: 9, which: 94 type: keyup, key: Dead, code: Tab, keyIdentifier: Unidentified, keyCode: 9, charCode: 0, keyCode: 9, which: 95 3 type: keydown, key: ArrowUp, code: ArrowUp, keyIdentifier: Up, keyCode: 38, charCode: 0, keyCode: 38, which: 38 6 4 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
r240742 r240983 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> 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.-->.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>. 16 16 </p> 17 17 <pre id="console"></pre> 18 18 <script> 19 19 var remainingKeysToPress = [ 20 "\t",21 20 "upArrow", 22 21 "downArrow", … … 28 27 "escape", 29 28 "home", 30 // FIXME: Add "insert" once <rdar://problem/47128940> is fixed.29 "insert", 31 30 "leftAlt", 32 31 "leftCommand", … … 42 41 ]; 43 42 44 // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed. 45 for (let i = 1; i <= 16; ++i) 43 for (let i = 1; i <= 24; ++i) 46 44 remainingKeysToPress.push("F" + i); 47 45 -
trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element-expected.txt
r240742 r240983 55 55 PASS escape did dispatch a keypress event. 56 56 PASS return did dispatch a keypress event. 57 FAIL forwardDelete should not have dispatched a keypress event. It did dispatch one.57 PASS forwardDelete did dispatch a keypress event. 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. 92 100 PASS successfullyParsed is true 93 101 -
trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element.html
r240742 r240983 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 44 48 // Special keys: KeyPress should not be dispatched. 45 tests.push(new TestKeyPressNotDispatchedFor("forwardDelete"));46 49 tests.push(new TestKeyPressNotDispatchedFor("upArrow")); 47 50 tests.push(new TestKeyPressNotDispatchedFor("downArrow")); … … 51 54 tests.push(new TestKeyPressNotDispatchedFor("end")); 52 55 tests.push(new TestKeyPressNotDispatchedFor("home")); 53 // FIXME: Test that keypress is not dispatched for "insert" once <rdar://problem/47128940> is fixed. 56 tests.push(new TestKeyPressNotDispatchedFor("insert")); 54 57 tests.push(new TestKeyPressNotDispatchedFor("leftAlt")); 55 58 tests.push(new TestKeyPressNotDispatchedFor("leftCommand")); … … 62 65 tests.push(new TestKeyPressNotDispatchedFor("rightControl")); 63 66 tests.push(new TestKeyPressNotDispatchedFor("rightShift")); 64 // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed. 65 for (let i = 1; i <= 16; ++i) 67 for (let i = 1; i <= 24; ++i) 66 68 tests.push(new TestKeyPressNotDispatchedFor("F" + i)); 67 69 -
trunk/Source/WebCore/ChangeLog
r240975 r240983 1 2019-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r240742. 4 5 Causes crashes on iOS simulator. 6 7 Reverted changeset: 8 9 "[iOS] Keyups for non-modifier keys identified as "Dead" when 10 not focused in a content-editable element" 11 https://bugs.webkit.org/show_bug.cgi?id=192824 12 https://trac.webkit.org/changeset/240742 13 1 14 2019-02-05 Zalan Bujtas <zalan@apple.com> 2 15 -
trunk/Source/WebCore/PAL/ChangeLog
r240892 r240983 1 2019-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r240742. 4 5 Causes crashes on iOS simulator. 6 7 Reverted changeset: 8 9 "[iOS] Keyups for non-modifier keys identified as "Dead" when 10 not focused in a content-editable element" 11 https://bugs.webkit.org/show_bug.cgi?id=192824 12 https://trac.webkit.org/changeset/240742 13 1 14 2018-12-16 Darin Adler <darin@apple.com> 2 15 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h
r240742 r240983 186 186 kHIDUsage_KeyboardCapsLock = 0x39, 187 187 kHIDUsage_KeyboardF1 = 0x3A, 188 kHIDUsage_KeyboardF12 = 0x45,189 188 kHIDUsage_KeyboardPrintScreen = 0x46, 190 189 kHIDUsage_KeyboardInsert = 0x49, … … 200 199 kHIDUsage_KeypadNumLock = 0x53, 201 200 kHIDUsage_KeyboardF13 = 0x68, 202 kHIDUsage_KeyboardF24 = 0x73,203 201 kHIDUsage_KeyboardMenu = 0x76, 204 202 kHIDUsage_KeyboardLeftControl = 0xE0, -
trunk/Source/WebCore/platform/ios/KeyEventIOS.mm
r240742 r240983 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 keyboard202 // keyup events because they lack a key code.203 200 int windowsKeyCodeForCharCode(unichar charCode) 204 201 { … … 207 204 case 9: return VK_TAB; 208 205 case 0xD: case 3: return VK_RETURN; 206 case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape. 209 207 case ' ': return VK_SPACE; 210 208 … … 246 244 case 'z': case 'Z': return VK_Z; 247 245 248 #if !USE(UIKIT_KEYBOARD_ADDITIONS)249 case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape.250 251 246 // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys. 252 247 case NSUpArrowFunctionKey: return VK_UP; … … 256 251 case NSPageUpFunctionKey: return VK_PRIOR; 257 252 case NSPageDownFunctionKey: return VK_NEXT; 258 #endif259 253 260 254 // This is for U.S. keyboard mapping, and doesn't necessarily make sense for different keyboard layouts. … … 278 272 { 279 273 switch (charCode) { 280 #if !USE(UIKIT_KEYBOARD_ADDITIONS)281 274 case 1: // Home 282 275 case 4: // End … … 284 277 case 0x7F: // Forward Delete 285 278 case 0x10: // Function key (e.g. F1, F2, ...) 286 #endif287 279 288 280 // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys. … … 294 286 case NSPageDownFunctionKey: 295 287 case NSClearLineFunctionKey: // Num Lock / Clear 296 #if USE(UIKIT_KEYBOARD_ADDITIONS)297 case NSDeleteFunctionKey: // Forward delete298 case NSEndFunctionKey:299 case NSInsertFunctionKey:300 case NSHomeFunctionKey:301 #endif302 288 return true; 303 289 } 304 #if USE(UIKIT_KEYBOARD_ADDITIONS)305 if (charCode >= NSF1FunctionKey && charCode <= NSF24FunctionKey)306 return true;307 #endif308 290 return false; 309 291 } -
trunk/Source/WebCore/platform/ios/WebEvent.mm
r240742 r240983 149 149 case kHIDUsage_KeypadNumLock: // Num Lock / Clear 150 150 return makeNSStringWithCharacter(NSClearLineFunctionKey); 151 #if USE(UIKIT_KEYBOARD_ADDITIONS) 152 case kHIDUsage_KeyboardDeleteForward: 153 return makeNSStringWithCharacter(NSDeleteFunctionKey); 154 case kHIDUsage_KeyboardEnd: 155 return makeNSStringWithCharacter(NSEndFunctionKey); 156 case kHIDUsage_KeyboardInsert: 157 return makeNSStringWithCharacter(NSInsertFunctionKey); 158 case kHIDUsage_KeyboardHome: 159 return makeNSStringWithCharacter(NSHomeFunctionKey); 160 #endif 161 } 162 #if USE(UIKIT_KEYBOARD_ADDITIONS) 163 if (keyCode >= kHIDUsage_KeyboardF1 && keyCode <= kHIDUsage_KeyboardF12) 164 return makeNSStringWithCharacter(NSF1FunctionKey + (keyCode - kHIDUsage_KeyboardF1)); 165 if (keyCode >= kHIDUsage_KeyboardF13 && keyCode <= kHIDUsage_KeyboardF24) 166 return makeNSStringWithCharacter(NSF13FunctionKey + (keyCode - kHIDUsage_KeyboardF13)); 167 #endif 151 } 168 152 return characters; 169 153 } -
trunk/Source/WebKit/ChangeLog
r240974 r240983 1 2019-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r240742. 4 5 Causes crashes on iOS simulator. 6 7 Reverted changeset: 8 9 "[iOS] Keyups for non-modifier keys identified as "Dead" when 10 not focused in a content-editable element" 11 https://bugs.webkit.org/show_bug.cgi?id=192824 12 https://trac.webkit.org/changeset/240742 13 1 14 2019-02-05 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r240875 r240983 261 261 WebKit::FocusedElementInformation _focusedElementInformation; 262 262 RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral; 263 #if !USE(UIKIT_KEYBOARD_ADDITIONS)264 263 RetainPtr<UIEvent> _uiEventBeingResent; 265 #endif266 264 BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler; 267 265 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r240882 r240983 60 60 #import "WKTimePickerViewController.h" 61 61 #import "WKUIDelegatePrivate.h" 62 #import "WKWebEvent.h" 62 63 #import "WKWebViewConfiguration.h" 63 64 #import "WKWebViewConfigurationPrivate.h" … … 121 122 #if ENABLE(INPUT_TYPE_COLOR) 122 123 #import "WKFormColorControl.h" 123 #endif124 125 #if !USE(UIKIT_KEYBOARD_ADDITIONS)126 #import "WKWebEvent.h"127 124 #endif 128 125 … … 1484 1481 } 1485 1482 1486 - (BOOL) shouldShowAutomaticKeyboardUI1487 { 1488 // FIXME: Make this function knowledgeable about the HTML attribute inputmode.1483 - (BOOL)_requiresKeyboardWhenFirstResponder 1484 { 1485 // FIXME: We should add the logic to handle keyboard visibility during focus redirects. 1489 1486 switch (_focusedElementInformation.elementType) { 1490 1487 case WebKit::InputType::None: … … 1504 1501 } 1505 1502 return NO; 1506 }1507 1508 #if USE(UIKIT_KEYBOARD_ADDITIONS)1509 - (BOOL)_disableAutomaticKeyboardUI1510 {1511 // Always enable automatic keyboard UI if we are not the first responder to avoid1512 // interfering with other focused views (e.g. Find-in-page).1513 return [self isFirstResponder] && ![self shouldShowAutomaticKeyboardUI];1514 }1515 #endif1516 1517 - (BOOL)_requiresKeyboardWhenFirstResponder1518 {1519 #if USE(UIKIT_KEYBOARD_ADDITIONS)1520 return YES;1521 #else1522 // FIXME: We should add the logic to handle keyboard visibility during focus redirects.1523 return [self shouldShowAutomaticKeyboardUI];1524 #endif1525 1503 } 1526 1504 … … 3930 3908 _traits = adoptNS([[UITextInputTraits alloc] init]); 3931 3909 3932 #if USE(UIKIT_KEYBOARD_ADDITIONS)3933 // Do not change traits when dismissing the keyboard.3934 if (_isBlurringFocusedNode)3935 return _traits.get();3936 #endif3937 3938 3910 [_traits setSecureTextEntry:_focusedElementInformation.elementType == WebKit::InputType::Password || [_formInputSession forceSecureTextEntry]]; 3939 3911 [_traits setShortcutConversionType:_focusedElementInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault]; … … 4093 4065 } 4094 4066 4095 #if !USE(UIKIT_KEYBOARD_ADDITIONS)4096 4067 - (void)_handleKeyUIEvent:(::UIEvent *)event 4097 4068 { … … 4118 4089 [self handleKeyWebEvent:webEvent.get()]; 4119 4090 } 4120 #endif4121 4091 4122 4092 - (void)handleKeyWebEvent:(::WebEvent *)theEvent … … 4146 4116 } 4147 4117 4148 #if !USE(UIKIT_KEYBOARD_ADDITIONS)4149 4118 // If we aren't interacting with editable content, we still need to call [super _handleKeyUIEvent:] 4150 4119 // so that keyboard repeat will work correctly. If we are interacting with editable content, … … 4165 4134 [super _handleKeyUIEvent:_uiEventBeingResent.get()]; 4166 4135 _uiEventBeingResent = nil; 4167 #endif4168 4136 } 4169 4137 … … 4770 4738 #if HAVE(PENCILKIT) 4771 4739 [_drawingCoordinator uninstallInkPicker]; 4772 #endif4773 4774 #if USE(UIKIT_KEYBOARD_ADDITIONS)4775 [self _endEditing];4776 4740 #endif 4777 4741 -
trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
r240742 r240983 79 79 @class WKSelectPopover; 80 80 81 #if USE(UIKIT_KEYBOARD_ADDITIONS)82 @interface WKSelectTableViewController : UITableViewController83 #else84 81 @interface WKSelectTableViewController : UITableViewController <UIKeyInput> 85 #endif86 82 { 87 83 NSUInteger _singleSelectionIndex; … … 364 360 } 365 361 366 #if !USE(UIKIT_KEYBOARD_ADDITIONS)367 362 #pragma mark UIKeyInput delegate methods 368 363 … … 379 374 { 380 375 } 381 382 #endif383 376 384 377 @end … … 418 411 419 412 [navController release]; 420 421 #if !USE(UIKIT_KEYBOARD_ADDITIONS) 413 422 414 [[UIKeyboardImpl sharedInstance] setDelegate:_tableViewController.get()]; 423 #endif424 415 425 416 return self; -
trunk/Tools/ChangeLog
r240982 r240983 1 2019-02-05 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r240742. 4 5 Causes crashes on iOS simulator. 6 7 Reverted changeset: 8 9 "[iOS] Keyups for non-modifier keys identified as "Dead" when 10 not focused in a content-editable element" 11 https://bugs.webkit.org/show_bug.cgi?id=192824 12 https://trac.webkit.org/changeset/240742 13 1 14 2019-02-05 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm
r240742 r240983 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 3;837 return kHIDUsage_KeyboardF13 + i - 1; 838 838 } 839 839 return WTF::nullopt;
Note: See TracChangeset
for help on using the changeset viewer.