[webkit-changes] [WebKit/WebKit] caddd0: [iOS] Safari hangs under sync IPC when requesting ...

Abrar Rahman Protyasha noreply at github.com
Wed May 31 11:30:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: caddd0f8263c37de2007be394191c8950df9aac4
      https://github.com/WebKit/WebKit/commit/caddd0f8263c37de2007be394191c8950df9aac4
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Tools/TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm
    M Tools/TestWebKitAPI/ios/UIKitSPI.h

  Log Message:
  -----------
  [iOS] Safari hangs under sync IPC when requesting autocorrection context
https://bugs.webkit.org/show_bug.cgi?id=257513
rdar://104969174

Reviewed by Wenson Hsieh.

After focusing on a text field, clients often hang under sync IPC when
requesting autocorrection context through -[WKContentView requestAutocorrectionContextWithCompletionHandler:].
Some analysis has shown that out-of-process keyboard codepaths have
mostly moved on to -[WKContentView requestDocumentContext:] instead, and
even though there are still calls made into -[WKContentView requestAutocorrectionContextWithCompletionHandler:],
it seems that autocorrect suggestions are unaffected by the results
provided by said method.

As such, we provide a mitigation to further harden us against hangs of
this nature by early returning with an empty autocorrection context if
out-of-process keyboard is detected.

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

Add new SPI declarations to detect out-of-process keyboard.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):

Early return with an empty autocorrection context when out-of-process
keyboard is detected.

* Tools/TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm:
(TEST):

Early return from tests in situations where -[WKContentView requestAutocorrectionContextWithCompletionHandler:]
is expected to be a no-op.

* Tools/TestWebKitAPI/ios/UIKitSPI.h:

Add new SPI declarations to detect out-of-process keyboard.

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




More information about the webkit-changes mailing list