[webkit-changes] [WebKit/WebKit] 64d46b: [iOS] Add experimental support for EID/IMEI AutoFi...

Wenson Hsieh noreply at github.com
Mon Oct 30 16:01:02 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 64d46bbaf793de4e47e68cda1e36119c3832480f
      https://github.com/WebKit/WebKit/commit/64d46bbaf793de4e47e68cda1e36119c3832480f
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-10-30 (Mon, 30 Oct 2023)

  Changed paths:
    M Source/WTF/wtf/PlatformHave.h
    M Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
    M Source/WebCore/PAL/pal/PlatformMac.cmake
    A Source/WebCore/PAL/pal/cocoa/CoreTelephonySoftLink.h
    A Source/WebCore/PAL/pal/cocoa/CoreTelephonySoftLink.mm
    A Source/WebCore/PAL/pal/spi/cocoa/CoreTelephonySPI.h
    M Source/WebCore/html/Autofill.cpp
    M Source/WebCore/html/Autofill.h
    M Source/WebKit/Platform/Logging.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/SourcesCocoa.txt
    A Source/WebKit/UIProcess/Cocoa/CoreTelephonyUtilities.h
    A Source/WebKit/UIProcess/Cocoa/CoreTelephonyUtilities.mm
    M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements
    M Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm

  Log Message:
  -----------
  [iOS] Add experimental support for EID/IMEI AutoFill in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=263831
rdar://116011445

Reviewed by Richard Robinson and Abrar Rahman Protyasha.

Add support for the `device-eid` and `device-imei` values for the `autocomplete` attribute, by
plumbing these values over to the `UITextContentTypeCellularEID` and `UITextContentTypeCellularIMEI`
platform text content types, respectively.

Test: KeyboardInputTests.DeviceEIDAndIMEIAutoFill

Source/WTF/wtf/PlatformHave.h:

Add a new compile-time flag to guard availability of the CoreTelephony framework.

* Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:
* Source/WebCore/PAL/pal/PlatformMac.cmake:
* Source/WebCore/PAL/pal/cocoa/CoreTelephonySoftLink.h: Added.
* Source/WebCore/PAL/pal/cocoa/CoreTelephonySoftLink.mm: Added.
* Source/WebCore/PAL/pal/spi/cocoa/CoreTelephonySPI.h: Added.

Add new SPI headers and soft-linking support for the CoreTelephony framework.

* Source/WebCore/html/Autofill.cpp:
* Source/WebCore/html/Autofill.h:

Add support for the new values.

* Source/WebKit/Platform/Logging.h:

Add a `Telephony` log channel.

* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/Cocoa/CoreTelephonyUtilities.h: Added.
* Source/WebKit/UIProcess/Cocoa/CoreTelephonyUtilities.mm: Added.

Call out to the CoreTelephony framework to query whether or not the current active URL is allowed
for the purposes of ESIM AutoFill.

(WebKit::shouldAllowAutoFillForCellularIdentifiers):
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::shouldAllowAutoFillForCellularIdentifiers const):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageLoadState const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView contentTypeFromFieldName:]):

Move this static helper into `WKContentView` as a regular method, so that we can call into
`WebPageProxy` and return either `nil` or the appropriate text content type, in the case of these
new `device-*` AutoFill types.

(-[WKContentView _updateTextInputTraits:]):
(-[WKContentView textContentTypeForQuickboard]):
(contentTypeFromFieldName): Deleted.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Configurations/TestWebKitAPI-iOS.entitlements:

Add an `com.apple.CommCenter.fine-grained` entitlement, so that we can test this new codepath.

* Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::allowESIMAutoFillForWebKitDomains):

Add a new API test to exercise the scenarios where CoreTelephony accepts or rejects AutoFill,
depending on the current domain.

Canonical link: https://commits.webkit.org/269980@main




More information about the webkit-changes mailing list