Bug 228802 - REGRESSION (r280492): Clicking backspace on sign in fields results in deleting two characters instead of one
Summary: REGRESSION (r280492): Clicking backspace on sign in fields results in deletin...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-04 15:25 PDT by Dana Estra
Modified: 2021-08-04 18:12 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.46 KB, patch)
2021-08-04 15:29 PDT, Dana Estra
no flags Details | Formatted Diff | Diff
Patch (1.45 KB, patch)
2021-08-04 16:07 PDT, Dana Estra
no flags Details | Formatted Diff | Diff
For EWS (4.87 KB, patch)
2021-08-04 17:56 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dana Estra 2021-08-04 15:25:09 PDT
REGRESSION (r280492): Clicking backspace on sign in fields results in deleting two characters instead of one
Comment 1 Dana Estra 2021-08-04 15:29:49 PDT
Created attachment 434942 [details]
Patch
Comment 2 Tim Horton 2021-08-04 15:43:29 PDT
Comment on attachment 434942 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        No tests yet.

The fact that this didn't break any tests is astounding; you should see if Wenson has any good ideas about how to test the software keyboard codepath (we may not have a good way, and no need for making one to block the regression fix).
Comment 3 Wenson Hsieh 2021-08-04 15:50:39 PDT
(In reply to Tim Horton from comment #2)
> Comment on attachment 434942 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434942&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        No tests yet.
> 
> The fact that this didn't break any tests is astounding; you should see if
> Wenson has any good ideas about how to test the software keyboard codepath
> (we may not have a good way, and no need for making one to block the
> regression fix).

The last time I looked into adding support for this, I did not find any straightforward way to achieve this (using API, SPI, or even IPI). That said, it has been several years since this investigation, so we should take another look at this!

(In the shorter term, perhaps it's also possible to write an API test that swizzles/mocks/calls directly into `WKContentView` to simulate pressing the delete key on the software keyboard on iOS).
Comment 4 Wenson Hsieh 2021-08-04 15:57:22 PDT
(In reply to Wenson Hsieh from comment #3)
> (In reply to Tim Horton from comment #2)
> > Comment on attachment 434942 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=434942&action=review
> > 
> > > Source/WebCore/ChangeLog:8
> > > +        No tests yet.
> > 
> > The fact that this didn't break any tests is astounding; you should see if
> > Wenson has any good ideas about how to test the software keyboard codepath
> > (we may not have a good way, and no need for making one to block the
> > regression fix).
> 
> The last time I looked into adding support for this, I did not find any
> straightforward way to achieve this (using API, SPI, or even IPI). That
> said, it has been several years since this investigation, so we should take
> another look at this!
> 
> (In the shorter term, perhaps it's also possible to write an API test that
> swizzles/mocks/calls directly into `WKContentView` to simulate pressing the
> delete key on the software keyboard on iOS).

From a quick debugging session on my iPhone, it looks like we might be able to grab the TIKeyboardLayout from the active UIKeyboardImpl, look up the frame (CGRect) of the corresponding key string, map that from input view coordinates into screen coordinates, and then synthesize HID events to tap the center of that rect.

I suppose any test that uses this mechanism would need to listen for DOM events (keyup) to know that the key press is finished.
Comment 5 Dana Estra 2021-08-04 16:07:03 PDT
Created attachment 434949 [details]
Patch
Comment 6 Wenson Hsieh 2021-08-04 16:08:54 PDT
rdar://81496530
Comment 7 EWS 2021-08-04 16:54:02 PDT
Committed r280671 (240276@main): <https://commits.webkit.org/240276@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434949 [details].
Comment 8 Wenson Hsieh 2021-08-04 17:56:44 PDT Comment hidden (obsolete)
Comment 9 Wenson Hsieh 2021-08-04 17:56:45 PDT Comment hidden (obsolete)
Comment 10 Wenson Hsieh 2021-08-04 17:57:36 PDT Comment hidden (obsolete)