Bug 223662 - [iOS] Date picker view jumps to center when switching between MobileSafari and another app
Summary: [iOS] Date picker view jumps to center when switching between MobileSafari an...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Other
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-23 16:05 PDT by Aditya Keerthi
Modified: 2021-03-25 13:22 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.31 KB, patch)
2021-03-23 16:07 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (15.43 KB, patch)
2021-03-24 15:51 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-03-23 16:05:13 PDT
...
Comment 1 Aditya Keerthi 2021-03-23 16:05:25 PDT
<rdar://problem/74748727>
Comment 2 Aditya Keerthi 2021-03-23 16:07:21 PDT
Created attachment 424075 [details]
Patch
Comment 3 Wenson Hsieh 2021-03-23 16:22:00 PDT
Comment on attachment 424075 [details]
Patch

I think this might not work if the focused element is partially occluded (such that the center is covered by another element), but this is kind of already a problem with this approach already (since the last interaction location isn't guaranteed to find the same element anyways).

It would probably be better if we used the focused element's ElementContext to make sure we're targeting the same element (or use the element context and grab the information we need from the same focused element).
Comment 4 Aditya Keerthi 2021-03-24 15:51:31 PDT
Created attachment 424193 [details]
Patch
Comment 5 Aditya Keerthi 2021-03-24 15:53:35 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 424075 [details]
> Patch
> 
> I think this might not work if the focused element is partially occluded
> (such that the center is covered by another element), but this is kind of
> already a problem with this approach already (since the last interaction
> location isn't guaranteed to find the same element anyways).
> 
> It would probably be better if we used the focused element's ElementContext
> to make sure we're targeting the same element (or use the element context
> and grab the information we need from the same focused element).

The latest patch uses the information in FocusedElementInformation to present the context menu for form controls, so we don't need to worry about the position information being correct.
Comment 6 Tim Horton 2021-03-25 13:12:57 PDT
Comment on attachment 424193 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:3080
> +#if ENABLE(ASYNC_SCROLLING)

Almost certainly unnecessary in this file but fine :)
Comment 7 EWS 2021-03-25 13:22:15 PDT
Committed r275054: <https://commits.webkit.org/r275054>

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