Bug 189389 - [iOS] Arrow keys do not dispatch DOM events to non-editable elements
Summary: [iOS] Arrow keys do not dispatch DOM events to non-editable elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 11
: P2 Normal
Assignee: Daniel Bates
URL: https://www.icloud.com
Keywords: InRadar, PlatformOnly
Depends on: 189381 189432
Blocks: 190571
  Show dependency treegraph
 
Reported: 2018-09-06 17:46 PDT by Daniel Bates
Modified: 2018-10-14 22:02 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.17 KB, patch)
2018-09-06 18:06 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
To land after landing bug #189432 (16.75 KB, patch)
2018-09-07 15:03 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-09-06 17:46:12 PDT
Pressing the arrow keys on a hardware keyboard in a focused text field does not dispatch DOM keyboard events. I observed this today on icloud.com. Here are the steps I performed:

1. Open an iPad simulator instance.
2. Visit https://www.icloud.com.
3. Tap the share button. Then tap Request Desktop Site from the share sheet.
4. Sign in to iCloud.
5. Tap Pages.
6. Tap the + icon at the top of the page to open the template chooser.
7. Press the right arrow key on the keyboard.

Then nothing happens. But the Blank Landscape template should have been selected (visually indicated by having an orange outline wrapped around it).
Comment 1 Daniel Bates 2018-09-06 18:06:48 PDT
Created attachment 349101 [details]
Patch
Comment 2 Daniel Bates 2018-09-06 18:07:36 PDT
We will need to fix bug #189388 in order to be able to write a test.
Comment 3 Simon Fraser (smfr) 2018-09-06 19:03:16 PDT
Comment on attachment 349101 [details]
Patch

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

> Source/WebCore/ChangeLog:16
> +        Unfortunately I ran into <https://bugs.webkit.org/show_bug.cgi?id=189388> and hence could
> +        not write a test for this change.

Should we fix that first so we can land with tests?

> Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm:174
> +        return "Unidentified"_s;

That's a bit weird to have in production code. Maybe return empty string?
Comment 4 Daniel Bates 2018-09-07 14:47:12 PDT
There is a related issue with regards to arrow keys and editable elements. See bug #189388.
Comment 5 Daniel Bates 2018-09-07 14:49:42 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 349101 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=349101&action=review
> 
> > Source/WebCore/ChangeLog:16
> > +        Unfortunately I ran into <https://bugs.webkit.org/show_bug.cgi?id=189388> and hence could
> > +        not write a test for this change.
> 
> Should we fix that first so we can land with tests?
> 

Will fix this in bug #189432 and update this patch to include updated expected results for the test included in the patch for bug #189432.

> > Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm:174
> > +        return "Unidentified"_s;
> 
> That's a bit weird to have in production code. Maybe return empty string?

This is the correct behavior by <https://www.w3.org/TR/uievents-key/#key-Unidentified>.
Comment 6 Daniel Bates 2018-09-07 15:03:31 PDT
Created attachment 349200 [details]
To land after landing bug #189432
Comment 7 Daniel Bates 2018-09-10 14:02:58 PDT
Committed r235860: <https://trac.webkit.org/changeset/235860>
Comment 8 Radar WebKit Bug Importer 2018-09-10 14:03:39 PDT
<rdar://problem/44316290>