Bug 223662

Summary: [iOS] Date picker view jumps to center when switching between MobileSafari and another app
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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].