Bug 166932

Summary: [iOS] Implement support for KeyboardEvent.code
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, benjamin, cmarcelo, commit-queue, darin, dbates, enrica, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Patch none

Description Chris Dumez 2017-01-11 10:45:22 PST
Implement support for KeyboardEvent.code on iOS.
Comment 1 Chris Dumez 2017-01-11 10:52:13 PST
Already supported on Mac.
Comment 2 Radar WebKit Bug Importer 2017-01-11 11:01:55 PST
<rdar://problem/29972518>
Comment 3 Chris Dumez 2017-01-11 19:44:22 PST
Created attachment 298652 [details]
WIP Patch
Comment 4 Build Bot 2017-01-11 21:18:01 PST
Comment on attachment 298652 [details]
WIP Patch

Attachment 298652 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2874983

New failing tests:
imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
fast/events/constructors/keyboard-event-constructor.html
Comment 5 Build Bot 2017-01-11 21:18:05 PST
Created attachment 298657 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 6 Chris Dumez 2017-01-12 09:21:37 PST
Created attachment 298688 [details]
Patch
Comment 7 Chris Dumez 2017-01-12 09:25:44 PST
Created attachment 298689 [details]
Patch
Comment 8 Darin Adler 2017-01-12 10:05:55 PST
Comment on attachment 298689 [details]
Patch

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

If most of this code ends up being identical for iOS and macOS it would be nice to do something so we have even less duplication.

> Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm:216
> +    case VK_RETURN: return ASCIILiteral("Enter"); //  Labeled Return on Apple keyboards.

Is this comment correct for iOS? Is the key actually labeled Return somewhere in iOS user interfaces? Or maybe we are referring to physical keyboards you can use?
Comment 9 Chris Dumez 2017-01-12 10:09:53 PST
Comment on attachment 298689 [details]
Patch

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

>> Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm:216
>> +    case VK_RETURN: return ASCIILiteral("Enter"); //  Labeled Return on Apple keyboards.
> 
> Is this comment correct for iOS? Is the key actually labeled Return somewhere in iOS user interfaces? Or maybe we are referring to physical keyboards you can use?

It is labeled "Return" on my software iOS keyboard.
Comment 10 Chris Dumez 2017-01-12 10:11:23 PST
(In reply to comment #8)
> Comment on attachment 298689 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=298689&action=review
> 
> If most of this code ends up being identical for iOS and macOS it would be
> nice to do something so we have even less duplication.

The virtual key codes are completely different. That said, we could have a table/array in a file somewhere (with key codes for each platform) and generate the switch() statements from it.
Comment 11 WebKit Commit Bot 2017-01-12 10:35:25 PST
Comment on attachment 298689 [details]
Patch

Clearing flags on attachment: 298689

Committed r210668: <http://trac.webkit.org/changeset/210668>
Comment 12 WebKit Commit Bot 2017-01-12 10:35:31 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Lucas Forschler 2019-02-06 09:18:54 PST
Mass move bugs into the DOM component.