Bug 169733

Summary: [Cocoa] Web Automation: non-sticky virtual keys like 'left arrow' don't work properly
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Proposed Fix (v2) joepeck: review+

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>