Bug 193048

Summary: [iOS] Pressing Tab key doesn't move to next cell with Google Sheets
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit Misc.Assignee: Daniel Bates <dbates>
Severity: Normal CC: bfulgham, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 12   
See Also: https://bugs.webkit.org/show_bug.cgi?id=192824
Bug Depends on:    
Bug Blocks: 190571, 193846    
Description Flags
dbates: review+
Patch - needs updated ChangeLog none

Description Daniel Bates 2018-12-28 11:59:19 PST
DOM events for the tab key are not dispatched as a result pressing the tab key in a Google Sheets document does not behave as it does on Mac.

Steps to reproduce:

1. Launch Safari.
2. Navigate to <https://sheets.google.com/>.
3. Open a spreadsheet.
4. Focus a cell.
5. Press the tab key.

Then nothing happens. But the cell in the adjacent column on the right should be focused.
Comment 1 Daniel Bates 2018-12-28 11:59:30 PST
Comment 2 Daniel Bates 2018-12-28 12:18:37 PST
Created attachment 358120 [details]

I suspect the reason we added these key commands was to work around an issue where key events when pressing Tab or Shift + Tab inside a password field would not be sent to WebKit as a result of UIKit decision to disallow the tab character inside a password field for native apps. I will fix address the UIKit issue in <rdar://problem/46972559>. For now, I did not include a test. I will add a test in a follow up bug.
Comment 3 Daniel Bates 2018-12-28 12:20:37 PST
Comment on attachment 358120 [details]

err, this patch will Tab and Shift + Tab in password fields in break current shipping iOS. Need to add some compile-time guards.
Comment 4 Daniel Bates 2019-01-02 10:57:05 PST
Created attachment 358185 [details]
Comment 5 Brent Fulgham 2019-01-04 13:19:03 PST
Comment on attachment 358185 [details]

LGTM. r=me.
Comment 6 Daniel Bates 2019-01-22 17:01:32 PST
Comment on attachment 358185 [details]

r-, this patch is insufficient as we need to support pressing tab to cycle out of form controls, such as <select>. Currently we make use of the fact that key commands are interpreted  even though we do not have a keyboard on iPad.
Comment 7 Daniel Bates 2019-01-22 17:03:32 PST
Created attachment 359811 [details]
Patch - needs updated ChangeLog
Comment 8 Daniel Bates 2019-01-25 14:32:07 PST
Comment on attachment 358185 [details]

I changed my mind. The original patch is OK as-is so long as it lands before bug #192824. When I r-'ed this patch it was before I had amended the patch on bug #192824 to support tab cycling from a focused <select> (and I got confused as to which patch was to blame - this one or the one on bug #192824 since I have both applied in my local repo :P). I've sorted it out, want this patch to land first, and updated the patch for bug #192824 to ensure it will not regress the fix made in this patch.

Filed bug #193846 to add tests for this change.
Comment 9 Daniel Bates 2019-01-25 15:12:50 PST
Committed r240514: <https://trac.webkit.org/changeset/240514>