Bug 227221

Summary: [iOS] Adopt new date picker presentation SPI
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, darin, ews-watchlist, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Aditya Keerthi 2021-06-21 09:54:44 PDT
...
Comment 1 Aditya Keerthi 2021-06-21 09:54:56 PDT
<rdar//problem/77930086>
Comment 2 Aditya Keerthi 2021-06-21 10:19:03 PDT
Created attachment 431873 [details]
Patch
Comment 3 Wenson Hsieh 2021-06-21 10:40:09 PDT
Comment on attachment 431873 [details]
Patch

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

> Source/WTF/ChangeLog:5
> +        <rdar//problem/77930086>

Ditto.

> Source/WebKit/ChangeLog:5
> +        <rdar//problem/77930086>

Nit - colon after the rdar.

(It looks like the Bugzilla comment is also missing it)

> Source/WebKit/Platform/spi/ios/UIKitSPI.h:1456
> +// FIXME: Import the header directly once bots are updated to a build containing rdar://77930086.

Did you mean to reference the UIKit radar (78779655) instead of this WebKit radar? (77930086).
Comment 4 Aditya Keerthi 2021-06-21 10:44:58 PDT
Created attachment 431876 [details]
Patch
Comment 5 Aditya Keerthi 2021-06-21 10:45:14 PDT
<rdar://problem/77930086>
Comment 6 Aditya Keerthi 2021-06-21 10:45:29 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 431873 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=431873&action=review
> 
> > Source/WTF/ChangeLog:5
> > +        <rdar//problem/77930086>
> 
> Ditto.
> 
> > Source/WebKit/ChangeLog:5
> > +        <rdar//problem/77930086>
> 
> Nit - colon after the rdar.
> 
> (It looks like the Bugzilla comment is also missing it)
> 
> > Source/WebKit/Platform/spi/ios/UIKitSPI.h:1456
> > +// FIXME: Import the header directly once bots are updated to a build containing rdar://77930086.
> 
> Did you mean to reference the UIKit radar (78779655) instead of this WebKit
> radar? (77930086).

Thanks for catching that!
Comment 7 Darin Adler 2021-06-21 16:03:33 PDT
Comment on attachment 431876 [details]
Patch

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

> Source/WTF/wtf/PlatformHave.h:1061
> +#if PLATFORM(IOS_FAMILY) && defined __has_include && __has_include(<UIKit/_UIDatePickerOverlayPresentation.h>)

This sort of thing is fragile. We do it when we have to, but in time it would be good to find something other than the detection of a header in the SDK to detect this.
Comment 8 Aditya Keerthi 2021-06-21 16:30:27 PDT
(In reply to Darin Adler from comment #7)
> Comment on attachment 431876 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=431876&action=review
> 
> > Source/WTF/wtf/PlatformHave.h:1061
> > +#if PLATFORM(IOS_FAMILY) && defined __has_include && __has_include(<UIKit/_UIDatePickerOverlayPresentation.h>)
> 
> This sort of thing is fragile. We do it when we have to, but in time it
> would be good to find something other than the detection of a header in the
> SDK to detect this.

I agree. I went with this approach because the header is relatively new. I intend to replace the header check with an iOS 15 check in a couple weeks time. I will file the follow-up bug once this patch is landed.
Comment 9 Wenson Hsieh 2021-06-23 09:14:42 PDT
Comment on attachment 431876 [details]
Patch

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

>>> Source/WTF/wtf/PlatformHave.h:1061
>>> +#if PLATFORM(IOS_FAMILY) && defined __has_include && __has_include(<UIKit/_UIDatePickerOverlayPresentation.h>)
>> 
>> This sort of thing is fragile. We do it when we have to, but in time it would be good to find something other than the detection of a header in the SDK to detect this.
> 
> I agree. I went with this approach because the header is relatively new. I intend to replace the header check with an iOS 15 check in a couple weeks time. I will file the follow-up bug once this patch is landed.

A `// FIXME: …` referencing a Bugzilla bug might be nice here, in the meantime.
Comment 10 Aditya Keerthi 2021-06-23 09:23:51 PDT
Created attachment 432058 [details]
Patch for landing
Comment 11 Aditya Keerthi 2021-06-23 09:25:08 PDT
webkit.org/b/227298 filed to remove the __has_include check.
Comment 12 EWS 2021-06-23 13:02:41 PDT
Committed r279181 (239077@main): <https://commits.webkit.org/239077@main>

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