Bug 169733 - [Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work properly
Summary: [Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-15 21:28 PDT by BJ Burg
Modified: 2017-03-19 08:54 PDT (History)
3 users (show)

See Also:


Attachments
Patch (47.57 KB, patch)
2017-03-15 22:08 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Proposed Fix (v2) (45.98 KB, patch)
2017-03-16 23:04 PDT, BJ Burg
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2017-03-15 21:28:44 PDT
This fixes several bugs which when combined prevent the arrow keys from being interpreted correctly.
Comment 1 BJ Burg 2017-03-15 21:29:04 PDT
<rdar://problem/30162608>
Comment 2 BJ Burg 2017-03-15 22:08:50 PDT
Created attachment 304611 [details]
Patch
Comment 3 BJ Burg 2017-03-16 23:04:43 PDT
Created attachment 304759 [details]
Proposed Fix (v2)
Comment 4 Joseph Pecoraro 2017-03-17 11:12:01 PDT
Comment on attachment 304759 [details]
Proposed Fix (v2)

View in context: https://bugs.webkit.org/attachment.cgi?id=304759&action=review

> Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:120
> -        [eventsToBeSent addObject:[[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:characters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey] autorelease]];
> +        [eventsToBeSent addObject:[[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:unmodifiedCharacters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey] autorelease]];

iOS build error, seems legit:

    CompileC WebAutomationSessionIOS.o
    Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:120:180: error: use of undeclared identifier 'unmodifiedCharacters'
            [eventsToBeSent addObject:[[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:unmodifiedCharacters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey] autorelease]];
                                                                                                                                                                                       ^
Comment 5 Joseph Pecoraro 2017-03-17 11:28:32 PDT
Comment on attachment 304759 [details]
Proposed Fix (v2)

View in context: https://bugs.webkit.org/attachment.cgi?id=304759&action=review

r=me, assuming you add unmodifiedCharacters to iOS similarly to how you did with Mac

> Source/WebKit2/UIProcess/Automation/mac/WebAutomationSessionMac.mm:328
> -        // The 'pause' key does not exist on Apple keyboards and has no keycode.
> +        // The 'pause' key does not exist on Apple keyboards and has no return

Find and replace error.

> Source/WebKit2/UIProcess/Automation/mac/WebAutomationSessionMac.mm:332
> -        // The 'cancel' key does not exist on Apple keyboards and has no keycode.
> +        // The 'cancel' key does not exist on Apple keyboards and has no return

Find and replace error.

> Source/WebKit2/UIProcess/Automation/mac/WebAutomationSessionMac.mm:353
> -        // The 'insert' key does not exist on Apple keyboards and has no keycode.
> +        // The 'insert' key does not exist on Apple keyboards and has no return

Find and replace error.
Comment 6 BJ Burg 2017-03-17 12:36:45 PDT
Comment on attachment 304759 [details]
Proposed Fix (v2)

View in context: https://bugs.webkit.org/attachment.cgi?id=304759&action=review

>> Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:120
>> +        [eventsToBeSent addObject:[[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:unmodifiedCharacters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey] autorelease]];
> 
> iOS build error, seems legit:
> 
>     CompileC WebAutomationSessionIOS.o
>     Source/WebKit2/UIProcess/Automation/ios/WebAutomationSessionIOS.mm:120:180: error: use of undeclared identifier 'unmodifiedCharacters'
>             [eventsToBeSent addObject:[[[::WebEvent alloc] initWithKeyEventType:WebEventKeyDown timeStamp:CFAbsoluteTimeGetCurrent() characters:characters charactersIgnoringModifiers:unmodifiedCharacters modifiers:m_currentModifiers isRepeating:NO withFlags:inputFlags withInputManagerHint:nil keyCode:keyCode isTabKey:isTabKey] autorelease]];
>                                                                                                                                                                                        ^

Yeah, I messed up the rebase. I'll test it locally again.
Comment 7 BJ Burg 2017-03-19 08:54:40 PDT
Committed r214144: <http://trac.webkit.org/changeset/214144>