Bug 215871

Summary: Switch to class method for smart insert/delete
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, darin, ews-watchlist, thorton, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Megan Gardner 2020-08-26 16:07:30 PDT
Switch to class method for smart insert/delete
Comment 1 Megan Gardner 2020-08-26 16:11:09 PDT
Created attachment 407349 [details]
Patch
Comment 2 Megan Gardner 2020-08-26 16:11:48 PDT
<rdar://problem/67281776>
Comment 3 Megan Gardner 2020-08-26 16:28:01 PDT
Created attachment 407352 [details]
Patch
Comment 4 Darin Adler 2020-08-26 16:34:26 PDT
Comment on attachment 407352 [details]
Patch

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

> Source/WebKit/UIProcess/ios/TextCheckerIOS.mm:120
> -    return [[UIKeyboardImpl sharedInstance] smartInsertDeleteIsEnabled];
> +    return [UIKeyboardImpl smartInsertDeleteIsEnabled];

This is available in all versions we need to support?
Comment 5 Megan Gardner 2020-08-26 16:39:36 PDT
Created attachment 407356 [details]
Patch
Comment 6 Darin Adler 2020-08-26 16:44:45 PDT
Comment on attachment 407356 [details]
Patch

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

> Source/WebKit/Platform/spi/ios/UIKitSPI.h:309
> +#if PLATFORM(IOS_FAMILY)

What’s the case of UIKit use with PLATFORM(IOS_FAMILY) false? I think there isn’t one because even Catalyst is part of that.
Comment 7 Megan Gardner 2020-08-26 17:13:22 PDT
Created attachment 407360 [details]
Patch
Comment 8 Darin Adler 2020-08-26 17:18:48 PDT
Comment on attachment 407360 [details]
Patch

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

> Source/WebKit/Platform/spi/ios/UIKitSPI.h:309
> -- (BOOL)smartInsertDeleteIsEnabled;
> ++ (BOOL)smartInsertDeleteIsEnabled;

Let me ask my original question again: Is this available in UIKit in the older versions of the various platforms that WebKit currently supports? Like if it was new to iOS 14 it would not be OK to use it unconditionally yet.
Comment 9 Megan Gardner 2020-08-26 18:04:06 PDT
Created attachment 407362 [details]
Patch
Comment 10 Darin Adler 2020-08-26 18:05:38 PDT
Comment on attachment 407362 [details]
Patch

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

> Source/WTF/wtf/PlatformHave.h:714
> +#define UIKEYBOARDIMPL_SMARTINSERTDELETE_CLASS_METHOD 1

This needs a HAVE_ prefix.
Comment 11 Megan Gardner 2020-08-26 18:06:36 PDT
Created attachment 407363 [details]
Patch
Comment 12 Tim Horton 2020-08-26 18:30:48 PDT
Comment on attachment 407363 [details]
Patch

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

> Source/WebKit/UIProcess/ios/TextCheckerIOS.mm:120
> +#if PLATFORM(HAVE_UIKEYBOARDIMPL_SMARTINSERTDELETE_CLASS_METHOD)

This is still not right. PLATFORM(HAVE_...)
Comment 13 Darin Adler 2020-08-26 18:40:47 PDT
Comment on attachment 407363 [details]
Patch

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

>> Source/WebKit/UIProcess/ios/TextCheckerIOS.mm:120
>> +#if PLATFORM(HAVE_UIKEYBOARDIMPL_SMARTINSERTDELETE_CLASS_METHOD)
> 
> This is still not right. PLATFORM(HAVE_...)

Oh, right:

   #if HAVE(
Comment 14 Megan Gardner 2020-08-27 10:36:43 PDT
Created attachment 407416 [details]
Patch
Comment 15 EWS 2020-09-01 11:13:57 PDT
Committed r266404: <https://trac.webkit.org/changeset/266404>

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