Changeset 240983 in webkit


Ignore:
Timestamp:
Feb 5, 2019 10:39:36 AM (5 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r240742.

Causes crashes on iOS simulator.

Reverted changeset:

"[iOS] Keyups for non-modifier keys identified as "Dead" when
not focused in a content-editable element"
https://bugs.webkit.org/show_bug.cgi?id=192824
https://trac.webkit.org/changeset/240742

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r240964 r240983  
     12019-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
    1142019-02-04  Jonathan Bedard  <jbedard@apple.com>
    215
  • 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.
     1This 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.
    22
    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
    53type: keydown, key: ArrowUp, code: ArrowUp, keyIdentifier: Up, keyCode: 38, charCode: 0, keyCode: 38, which: 38
    64type: 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  
    1313</head>
    1414<body onkeydown="handleKeyDown(event)" onkeyup="handleKeyUp(event)">
    15 <p>This tests that DOM keydown and keyup events are dispatched to a non-editable &lt;body&gt; 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 &lt;body&gt; 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>.
    1616</p>
    1717<pre id="console"></pre>
    1818<script>
    1919var remainingKeysToPress = [
    20     "\t",
    2120    "upArrow",
    2221    "downArrow",
     
    2827    "escape",
    2928    "home",
    30     // FIXME: Add "insert" once <rdar://problem/47128940> is fixed.
     29    "insert",
    3130    "leftAlt",
    3231    "leftCommand",
     
    4241];
    4342
    44 // FIXME: Check function keys up to F24 once <rdar://problem/47128940> is fixed.
    45 for (let i = 1; i <= 16; ++i)
     43for (let i = 1; i <= 24; ++i)
    4644    remainingKeysToPress.push("F" + i);
    4745
  • trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element-expected.txt

    r240742 r240983  
    5555PASS escape did dispatch a keypress event.
    5656PASS return did dispatch a keypress event.
    57 FAIL forwardDelete should not have dispatched a keypress event. It did dispatch one.
     57PASS forwardDelete did dispatch a keypress event.
    5858PASS upArrow did not dispatch a keypress event.
    5959PASS downArrow did not dispatch a keypress event.
     
    9090PASS F15 did not dispatch a keypress event.
    9191PASS F16 did not dispatch a keypress event.
     92PASS F17 did not dispatch a keypress event.
     93PASS F18 did not dispatch a keypress event.
     94PASS F19 did not dispatch a keypress event.
     95PASS F20 did not dispatch a keypress event.
     96PASS F21 did not dispatch a keypress event.
     97PASS F22 did not dispatch a keypress event.
     98PASS F23 did not dispatch a keypress event.
     99PASS F24 did not dispatch a keypress event.
    92100PASS successfullyParsed is true
    93101
  • trunk/LayoutTests/fast/events/ios/keypress-keys-in-non-editable-element.html

    r240742 r240983  
    4242tests.push(new TestKeyPressDispatchedFor("return"));
    4343
     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.
     46tests.push(new TestKeyPressDispatchedFor("forwardDelete"));
     47
    4448// Special keys: KeyPress should not be dispatched.
    45 tests.push(new TestKeyPressNotDispatchedFor("forwardDelete"));
    4649tests.push(new TestKeyPressNotDispatchedFor("upArrow"));
    4750tests.push(new TestKeyPressNotDispatchedFor("downArrow"));
     
    5154tests.push(new TestKeyPressNotDispatchedFor("end"));
    5255tests.push(new TestKeyPressNotDispatchedFor("home"));
    53 // FIXME: Test that keypress is not dispatched for "insert" once <rdar://problem/47128940> is fixed.
     56tests.push(new TestKeyPressNotDispatchedFor("insert"));
    5457tests.push(new TestKeyPressNotDispatchedFor("leftAlt"));
    5558tests.push(new TestKeyPressNotDispatchedFor("leftCommand"));
     
    6265tests.push(new TestKeyPressNotDispatchedFor("rightControl"));
    6366tests.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)
     67for (let i = 1; i <= 24; ++i)
    6668    tests.push(new TestKeyPressNotDispatchedFor("F" + i));
    6769
  • trunk/Source/WebCore/ChangeLog

    r240975 r240983  
     12019-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
    1142019-02-05  Zalan Bujtas  <zalan@apple.com>
    215
  • trunk/Source/WebCore/PAL/ChangeLog

    r240892 r240983  
     12019-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
    1142018-12-16  Darin Adler  <darin@apple.com>
    215
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/IOKitSPI.h

    r240742 r240983  
    186186    kHIDUsage_KeyboardCapsLock = 0x39,
    187187    kHIDUsage_KeyboardF1 = 0x3A,
    188     kHIDUsage_KeyboardF12 = 0x45,
    189188    kHIDUsage_KeyboardPrintScreen = 0x46,
    190189    kHIDUsage_KeyboardInsert = 0x49,
     
    200199    kHIDUsage_KeypadNumLock = 0x53,
    201200    kHIDUsage_KeyboardF13 = 0x68,
    202     kHIDUsage_KeyboardF24 = 0x73,
    203201    kHIDUsage_KeyboardMenu = 0x76,
    204202    kHIDUsage_KeyboardLeftControl = 0xE0,
  • trunk/Source/WebCore/platform/ios/KeyEventIOS.mm

    r240742 r240983  
    198198}
    199199
    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.
    203200int windowsKeyCodeForCharCode(unichar charCode)
    204201{
     
    207204    case 9: return VK_TAB;
    208205    case 0xD: case 3: return VK_RETURN;
     206    case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape.
    209207    case ' ': return VK_SPACE;
    210208
     
    246244    case 'z': case 'Z': return VK_Z;
    247245
    248 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    249     case 0x1B: return VK_ESCAPE; // WebKit generated code for Escape.
    250 
    251246    // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys.
    252247    case NSUpArrowFunctionKey: return VK_UP;
     
    256251    case NSPageUpFunctionKey: return VK_PRIOR;
    257252    case NSPageDownFunctionKey: return VK_NEXT;
    258 #endif
    259253
    260254    // This is for U.S. keyboard mapping, and doesn't necessarily make sense for different keyboard layouts.
     
    278272{
    279273    switch (charCode) {
    280 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    281274    case 1: // Home
    282275    case 4: // End
     
    284277    case 0x7F: // Forward Delete
    285278    case 0x10: // Function key (e.g. F1, F2, ...)
    286 #endif
    287279
    288280    // WebKit uses Unicode PUA codes in the OpenStep reserve range for some special keys.
     
    294286    case NSPageDownFunctionKey:
    295287    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
    302288        return true;
    303289    }
    304 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    305     if (charCode >= NSF1FunctionKey && charCode <= NSF24FunctionKey)
    306         return true;
    307 #endif
    308290    return false;
    309291}
  • trunk/Source/WebCore/platform/ios/WebEvent.mm

    r240742 r240983  
    149149    case kHIDUsage_KeypadNumLock: // Num Lock / Clear
    150150        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    }
    168152    return characters;
    169153}
  • trunk/Source/WebKit/ChangeLog

    r240974 r240983  
     12019-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
    1142019-02-05  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r240875 r240983  
    261261    WebKit::FocusedElementInformation _focusedElementInformation;
    262262    RetainPtr<NSObject<WKFormPeripheral>> _inputPeripheral;
    263 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    264263    RetainPtr<UIEvent> _uiEventBeingResent;
    265 #endif
    266264    BlockPtr<void(::WebEvent *, BOOL)> _keyWebEventHandler;
    267265
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r240882 r240983  
    6060#import "WKTimePickerViewController.h"
    6161#import "WKUIDelegatePrivate.h"
     62#import "WKWebEvent.h"
    6263#import "WKWebViewConfiguration.h"
    6364#import "WKWebViewConfigurationPrivate.h"
     
    121122#if ENABLE(INPUT_TYPE_COLOR)
    122123#import "WKFormColorControl.h"
    123 #endif
    124 
    125 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    126 #import "WKWebEvent.h"
    127124#endif
    128125
     
    14841481}
    14851482
    1486 - (BOOL)shouldShowAutomaticKeyboardUI
    1487 {
    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.
    14891486    switch (_focusedElementInformation.elementType) {
    14901487    case WebKit::InputType::None:
     
    15041501    }
    15051502    return NO;
    1506 }
    1507 
    1508 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    1509 - (BOOL)_disableAutomaticKeyboardUI
    1510 {
    1511     // Always enable automatic keyboard UI if we are not the first responder to avoid
    1512     // interfering with other focused views (e.g. Find-in-page).
    1513     return [self isFirstResponder] && ![self shouldShowAutomaticKeyboardUI];
    1514 }
    1515 #endif
    1516 
    1517 - (BOOL)_requiresKeyboardWhenFirstResponder
    1518 {
    1519 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    1520     return YES;
    1521 #else
    1522     // FIXME: We should add the logic to handle keyboard visibility during focus redirects.
    1523     return [self shouldShowAutomaticKeyboardUI];
    1524 #endif
    15251503}
    15261504
     
    39303908        _traits = adoptNS([[UITextInputTraits alloc] init]);
    39313909
    3932 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    3933     // Do not change traits when dismissing the keyboard.
    3934     if (_isBlurringFocusedNode)
    3935         return _traits.get();
    3936 #endif
    3937 
    39383910    [_traits setSecureTextEntry:_focusedElementInformation.elementType == WebKit::InputType::Password || [_formInputSession forceSecureTextEntry]];
    39393911    [_traits setShortcutConversionType:_focusedElementInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault];
     
    40934065}
    40944066
    4095 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    40964067- (void)_handleKeyUIEvent:(::UIEvent *)event
    40974068{
     
    41184089    [self handleKeyWebEvent:webEvent.get()];
    41194090}
    4120 #endif
    41214091
    41224092- (void)handleKeyWebEvent:(::WebEvent *)theEvent
     
    41464116    }
    41474117
    4148 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    41494118    // If we aren't interacting with editable content, we still need to call [super _handleKeyUIEvent:]
    41504119    // so that keyboard repeat will work correctly. If we are interacting with editable content,
     
    41654134    [super _handleKeyUIEvent:_uiEventBeingResent.get()];
    41664135    _uiEventBeingResent = nil;
    4167 #endif
    41684136}
    41694137
     
    47704738#if HAVE(PENCILKIT)
    47714739    [_drawingCoordinator uninstallInkPicker];
    4772 #endif
    4773 
    4774 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    4775     [self _endEditing];
    47764740#endif
    47774741
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm

    r240742 r240983  
    7979@class WKSelectPopover;
    8080
    81 #if USE(UIKIT_KEYBOARD_ADDITIONS)
    82 @interface WKSelectTableViewController : UITableViewController
    83 #else
    8481@interface WKSelectTableViewController : UITableViewController <UIKeyInput>
    85 #endif
    8682{
    8783    NSUInteger _singleSelectionIndex;
     
    364360}
    365361
    366 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
    367362#pragma mark UIKeyInput delegate methods
    368363
     
    379374{
    380375}
    381 
    382 #endif
    383376
    384377@end
     
    418411
    419412    [navController release];
    420 
    421 #if !USE(UIKIT_KEYBOARD_ADDITIONS)
     413   
    422414    [[UIKeyboardImpl sharedInstance] setDelegate:_tableViewController.get()];
    423 #endif
    424415   
    425416    return self;
  • trunk/Tools/ChangeLog

    r240982 r240983  
     12019-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
    1142019-02-05  Jonathan Bedard  <jbedard@apple.com>
    215
  • trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm

    r240742 r240983  
    835835    for (int i = 13; i <= 24; ++i) {
    836836        if ([key isEqualToString:[NSString stringWithFormat:@"F%d", i]])
    837             return kHIDUsage_KeyboardF13 + i - 13;
     837            return kHIDUsage_KeyboardF13 + i - 1;
    838838    }
    839839    return WTF::nullopt;
Note: See TracChangeset for help on using the changeset viewer.