Bug 225541 - [iPadOS] Do not present custom input peripherals when switching back to a tab with a focused element
Summary: [iPadOS] Do not present custom input peripherals when switching back to a tab...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-07 15:03 PDT by Aditya Keerthi
Modified: 2021-05-10 09:26 PDT (History)
4 users (show)

See Also:


Attachments
Patch (11.45 KB, patch)
2021-05-07 15:08 PDT, Aditya Keerthi
wenson_hsieh: review+
Details | Formatted Diff | Diff
Patch for landing (12.90 KB, patch)
2021-05-07 17:20 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2021-05-07 15:03:17 PDT
...
Comment 1 Aditya Keerthi 2021-05-07 15:03:34 PDT
<rdar://problem/77537795>
Comment 2 Aditya Keerthi 2021-05-07 15:08:11 PDT
Created attachment 428038 [details]
Patch
Comment 3 Wenson Hsieh 2021-05-07 15:17:43 PDT
Comment on attachment 428038 [details]
Patch

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

> LayoutTests/fast/forms/ios/focus-select-and-switch-tabs.html:35
> +    await UIHelper.delayFor(2000);

Nit - though an arbitrary time for a test like this is fine, 2 seconds seems a tad excessive…

Does it still reliably fail (without the fix) if we bring it down to say, 500 ms?
Comment 4 Wenson Hsieh 2021-05-07 15:25:37 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 428038 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=428038&action=review
> 
> > LayoutTests/fast/forms/ios/focus-select-and-switch-tabs.html:35
> > +    await UIHelper.delayFor(2000);
> 
> Nit - though an arbitrary time for a test like this is fine, 2 seconds seems
> a tad excessive…
> 
> Does it still reliably fail (without the fix) if we bring it down to say,
> 500 ms?

Alternately, a faster (and potentially more reliable way to test) might be to add a script controller hook to query whether or not there's an active input peripheral, and then just wait for a presentation update (to ensure that the UI process receives the `_elementDidFocus:`, and then just check that the hook returns `NO`).
Comment 5 Aditya Keerthi 2021-05-07 17:20:21 PDT
Created attachment 428064 [details]
Patch for landing
Comment 6 Aditya Keerthi 2021-05-07 17:21:44 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 428038 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=428038&action=review
> 
> > LayoutTests/fast/forms/ios/focus-select-and-switch-tabs.html:35
> > +    await UIHelper.delayFor(2000);
> 
> Nit - though an arbitrary time for a test like this is fine, 2 seconds seems
> a tad excessive…
> 
> Does it still reliably fail (without the fix) if we bring it down to say,
> 500 ms?

Removed the arbitrary time by waiting for a presentation update and attempting to use the menu to change the selected option.
Comment 7 EWS 2021-05-10 09:26:24 PDT
Committed r277265 (237532@main): <https://commits.webkit.org/237532@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428064 [details].