Bug 166932 - [iOS] Implement support for KeyboardEvent.code
Summary: [iOS] Implement support for KeyboardEvent.code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-11 10:45 PST by Chris Dumez
Modified: 2019-02-06 09:18 PST (History)
9 users (show)

See Also:


Attachments
WIP Patch (15.75 KB, patch)
2017-01-11 19:44 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews125 for ios-simulator-wk2 (9.44 MB, application/zip)
2017-01-11 21:18 PST, Build Bot
no flags Details
Patch (19.62 KB, patch)
2017-01-12 09:21 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (25.03 KB, patch)
2017-01-12 09:25 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.