[webkit-changes] [WebKit/WebKit] edd2d7: Move off of UIKit SPI: UIWebFormAccessory and UIWe...

Wenson Hsieh noreply at github.com
Tue Sep 26 15:51:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: edd2d7016e2d3e144e9cdf36b13da64e92b1c994
      https://github.com/WebKit/WebKit/commit/edd2d7016e2d3e144e9cdf36b13da64e92b1c994
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-09-26 (Tue, 26 Sep 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    A Source/WebKit/UIProcess/ios/forms/WKFormAccessoryView.h
    A Source/WebKit/UIProcess/ios/forms/WKFormAccessoryView.mm
    M Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm
    M Tools/TestWebKitAPI/ios/UIKitSPI.h

  Log Message:
  -----------
  Move off of UIKit SPI: UIWebFormAccessory and UIWebFormAccessoryDelegate
https://bugs.webkit.org/show_bug.cgi?id=262121

Reviewed by Tim Horton.

Stop using this SPI class and delegate protocol; instead, introduce `WKFormAccessoryView` and
`WKFormAccessoryViewDelegate`, which are (nearly) drop-in replacements for `UIWebFormAccessory`.
The only functionality on `UIWebFormAccessory` which we drop in our new WebKit class is support for
showing a "Clear" button (`-setClearVisible:`), which was only necessary when using the "wheels of
time" UI in the keyboard on iPhone; this hasn't been necessary since the form control refresh,
which moved date pickers into a context menu presentation (and more recently, into popover UI).

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:

Remove now-unused SPI declarations.

* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession accessoryViewCustomButtonTitle]):
(-[WKContentView accessoryDone]):
(-[WKContentView accessoryViewDone:]):
(-[WKContentView accessoryTab:]):
(-[WKContentView accessoryView:tabInDirection:]):

Instead of using the existing `-accessoryTab:` delegate that takes a `BOOL`, we can instead use an
`enum class` to represent the direction (next or previous) for slightly better clarity.

(-[WKContentView accessoryViewAutoFill:]):
(-[WKContentView formAccessoryView]):
(-[WKContentView _updateAccessory]):
(-[WKContentView accessoryClear]): Deleted.
(-[WKContentView accessoryAutoFill]): Deleted.

Make `_formAccessoryView` a `WKFormAccessoryView` instead of a `UIWebFormAccessory`, and conform to
`WKFormAccessoryViewDelegate` instead of `UIWebFormAccessoryDelegate`.

* Source/WebKit/UIProcess/ios/forms/WKFormAccessoryView.h: Added.
* Source/WebKit/UIProcess/ios/forms/WKFormAccessoryView.mm: Added.
(WebKit::doneButtonFont):
(WebKit::singleLineAutoFillButtonFont):
(WebKit::multipleLineAutoFillButtonFont):
(WebKit::upArrow):
(WebKit::downArrow):
(WebKit::createToolbarWithItems):
(-[WKFormAccessoryView _initForUniversalControlBar:]):
(-[WKFormAccessoryView initWithInputAssistantItem:delegate:]):
(-[WKFormAccessoryView traitCollectionDidChange:]):
(-[WKFormAccessoryView _updateFrame]):
(-[WKFormAccessoryView layoutSubviews]):
(-[WKFormAccessoryView _done]):
(-[WKFormAccessoryView _previousTapped]):
(-[WKFormAccessoryView _nextTapped]):
(-[WKFormAccessoryView _autoFill]):
(-[WKFormAccessoryView _autoFillButton]):
(-[WKFormAccessoryView _refreshAutofillPresentation]):
(-[WKFormAccessoryView _applyTreatmentToAutoFillLabel]):
(-[WKFormAccessoryView hideAutoFillButton]):
(-[WKFormAccessoryView showAutoFillButtonWithTitle:]):
(-[WKFormAccessoryView autoFillButtonItem]):
(-[WKFormAccessoryView setNextPreviousItemsVisible:]):
(-[WKFormAccessoryView setNextEnabled:]):
(-[WKFormAccessoryView isNextEnabled]):
(-[WKFormAccessoryView setPreviousEnabled:]):
(-[WKFormAccessoryView isPreviousEnabled]):
(-[WKFormAccessoryView contentRatio]):
* Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm:
(WebKit::DisplayCaptureSessionManager::promptForGetDisplayMedia):

Unrelated unified source build fix.

* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/ios/UIKitSPI.h:

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




More information about the webkit-changes mailing list